fix: send script file not working

This commit is contained in:
hyb1996
2017-12-31 18:00:54 +08:00
parent 5ed6e2bea8
commit 1784a9f84d

View File

@@ -135,10 +135,11 @@ public class Scripts {
} }
public static void send(ScriptFile file) { public static void send(ScriptFile file) {
Uri uri = Uri.parse("file://" + file.getPath()); App.getApp().startActivity(Intent.createChooser(new Intent(Intent.ACTION_SEND)
App.getApp().startActivity(new Intent(Intent.ACTION_SEND) .setType("text/plain")
.setDataAndType(uri, "text/plain") .putExtra(Intent.EXTRA_STREAM, Uri.fromFile(file)),
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)); App.getApp().getString(R.string.text_send)
));
} }
} }