use of com.stardust.autojs.annotation.ScriptInterface in project Auto.js by hyb1996.
the class AppUtils method viewFile.
@ScriptInterface
public void viewFile(String path) {
if (path == null)
throw new NullPointerException("path == null");
path = "file://" + path;
String mimeType = MimeTypes.fromFileOr(path, "*/*");
mContext.startActivity(new Intent(Intent.ACTION_VIEW).setDataAndType(Uri.parse(path), mimeType).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
}
use of com.stardust.autojs.annotation.ScriptInterface in project Auto.js by hyb1996.
the class AppUtils method editFile.
@ScriptInterface
public void editFile(String path) {
if (path == null)
throw new NullPointerException("path == null");
path = "file://" + path;
String mimeType = MimeTypes.fromFileOr(path, "*/*");
mContext.startActivity(new Intent(Intent.ACTION_EDIT).setDataAndType(Uri.parse(path), mimeType).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
}
Aggregations