?
如何在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);