fix flash when launch a shortcut

This commit is contained in:
hyb1996
2017-07-02 15:28:30 +08:00
parent a87cf6fc3a
commit 306cf4c5d3
7 changed files with 51 additions and 14 deletions

View File

@@ -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)) {

View File

@@ -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;
/**

View File

@@ -23,10 +23,6 @@ public class ShortcutActivity extends Activity {
if (new PathChecker(this).checkAndToastError(path)) {
runScriptFile(path);
}
}
public void onStart() {
super.onStart();
finish();
}

View File

@@ -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() {