Android 我可以使用A检查B未安装的应用程序A和B吗?
我不得不在我的安卓手机上使用两个我命名为A&B的应用程序。 A检查B是否未安装在mobile中。 我能做这个吗?Android 我可以使用A检查B未安装的应用程序A和B吗?,android,installed-applications,Android,Installed Applications,我不得不在我的安卓手机上使用两个我命名为A&B的应用程序。 A检查B是否未安装在mobile中。 我能做这个吗? 我使用应用程序克隆器、APK编辑器、APK管理器和其他一些应用程序来重命名应用程序名称,但它不起作用。我使用以下方法 boolean isAppInstalled = appInstalledOrNot("com.check.application"); if(isAppInstalled) { //This intent will help you t
我使用应用程序克隆器、APK编辑器、APK管理器和其他一些应用程序来重命名应用程序名称,但它不起作用。我使用以下方法
boolean isAppInstalled = appInstalledOrNot("com.check.application");
if(isAppInstalled) {
//This intent will help you to launch if the package is already installed
Intent LaunchIntent = getPackageManager()
.getLaunchIntentForPackage("com.check.application");
startActivity(LaunchIntent);
Log.i("Application is already installed.");
} else {
// Do whatever we want to do if application not installed
// For example, Redirect to play store
Log.i("Application is not currently installed.");
}
希望这有帮助是的,是的,因为有一个插件或代码可以直接帮助您检查应用程序是否已经就绪 布尔值isAppInstalled=appInstalledOrNotcom.check.application
if(isAppInstalled) {
//This intent will help you to launch if the package is already installed
Intent LaunchIntent = getPackageManager()
.getLaunchIntentForPackage("com.check.application");
startActivity(LaunchIntent);
Log.i("Application is already installed.");
} else {
// Do whatever we want to do if application not installed
// For example, Redirect to play store
Log.i("Application is not currently installed.");
}
您可以在希望检查应用程序是否已安装的位置调用此方法
希望这有帮助有插件吗?说真的??不,插件需要你找到它,这是什么意思?这个问题甚至与编程有关吗?
private boolean appInstalledOrNot(String uri) {
PackageManager pm = getPackageManager();
try {
pm.getPackageInfo(uri, PackageManager.GET_ACTIVITIES);
return true;
} catch (PackageManager.NameNotFoundException e) {
}
return false;`
}