读书人

怎么在android应用中执行另一个androi

发布时间: 2012-08-26 16:48:05 作者: rapoo

如何在android应用中执行另一个android应用

?

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

读书人网 >Android

热点推荐