如何在android应用中执行另一个android应用
InstallReceiver mInstallReceiver = new InstallReceiver();
IntentFilter filter = new IntentFilter(Intent.ACTION_PACKAGE_INSTALL);
filter.addAction(Intent.ACTION_PACKAGE_ADDED);
filter.addDataScheme("package");
registerReceiver(mInstallReceiver, filter);
Intent i = new Intent(Intent.ACTION_VIEW);
i.setDataAndType(Uri.fromFile(new File(apkPath)),
"application/vnd.android.package-archive");
startActivity(i);
InstallReceiver mInstallReceiver = new InstallReceiver();
IntentFilter filter = new IntentFilter(Intent.ACTION_PACKAGE_INSTALL);
filter.addAction(Intent.ACTION_PACKAGE_ADDED);
filter.addDataScheme("package");
registerReceiver(mInstallReceiver, filter);
Intent i = new Intent(Intent.ACTION_VIEW);
i.setDataAndType(Uri.fromFile(new File(apkPath)),
"application/vnd.android.package-archive");
startActivity(i);
本文介绍了一种在Android应用中启动另一个应用的方法。通过创建InstallReceiver并注册对应的Broadcast Receiver监听安装事件,然后使用Intent启动目标应用的安装流程。

被折叠的 条评论
为什么被折叠?



