fix flash when launch a shortcut
This commit is contained in:
@@ -38,10 +38,11 @@
|
||||
|
||||
<activity
|
||||
android:name=".external.shortcut.ShortcutActivity"
|
||||
android:theme="@style/AppTheme.NoActionBar">
|
||||
android:taskAffinity="com.stardust.scriptdroid.external.shortcut.ShortcutActivity"
|
||||
android:theme="@android:style/Theme.NoDisplay">
|
||||
|
||||
<intent-filter>
|
||||
<action android:name="com.example.Project.Action"/>
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
<category android:name="android.intent.category.DEFAULT"/>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
@@ -151,7 +152,9 @@
|
||||
<activity
|
||||
android:name=".external.open.RunIntentActivity"
|
||||
android:icon="@drawable/ic_ali_run"
|
||||
android:label="运行脚本">
|
||||
android:label="运行脚本"
|
||||
android:taskAffinity="com.stardust.scriptdroid.external.open.RunIntentActivity"
|
||||
android:theme="@android:style/Theme.NoDisplay">
|
||||
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW"/>
|
||||
|
||||
@@ -33,7 +33,6 @@ public class CommonUtils {
|
||||
String directoryPath = null;
|
||||
String script = intent.getStringExtra(CommonUtils.EXTRA_KEY_PRE_EXECUTE_SCRIPT);
|
||||
ScriptSource source = null;
|
||||
Toast.makeText(context, path, Toast.LENGTH_SHORT).show();
|
||||
if (path == null && script != null) {
|
||||
source = new StringScriptSource(script);
|
||||
} else if (path != null && new PathChecker(context).checkAndToastError(path)) {
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.stardust.scriptdroid.external.shortcut;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Bundle;
|
||||
|
||||
/**
|
||||
|
||||
@@ -23,10 +23,6 @@ public class ShortcutActivity extends Activity {
|
||||
if (new PathChecker(this).checkAndToastError(path)) {
|
||||
runScriptFile(path);
|
||||
}
|
||||
}
|
||||
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
finish();
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ public class ScriptFile extends File {
|
||||
if (isDirectory())
|
||||
return renameTo(new File(getParent(), newName));
|
||||
else
|
||||
return renameTo(new File(getParent(), newName + getExtension()));
|
||||
return renameTo(new File(getParent(), newName + "." + getExtension()));
|
||||
}
|
||||
|
||||
private String getExtension() {
|
||||
|
||||
Reference in New Issue
Block a user