-3
1)我可以在android中添加apk文件作爲擴展文件。 2)我試圖直接從外部存儲啓動應用程序,但出現錯誤。如何添加apk文件作爲擴展文件並直接在android中從外部存儲啓動?
代碼: -
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(new File("storage/emulated/0/Android/obb/devui1.example.com.testing/main.98376.devui1.example.com.testing.obb/app-debug.apk")), "application/vnd.android.package-archive");
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // without this flag android returned a intent error!
startActivity(intent);