我必须在我命名为 A 和 B 的 Android 手机上使用两个应用程序
。A 检查 B 未安装在手机中。
我可以这样做吗?
我使用应用克隆器、APK 编辑器、APK 管理器和其他一些应用来重命名应用名称,但它不起作用。
问问题
75 次
3 回答
0
private boolean appInstalledOrNot(String uri) {
PackageManager pm = getPackageManager();
try {
pm.getPackageInfo(uri, PackageManager.GET_ACTIVITIES);
return true;
} catch (PackageManager.NameNotFoundException e) {
}
return false;`
}
您可以在要检查应用程序是否已安装的地方调用此方法希望这会有所帮助
于 2018-01-08T06:31:26.477 回答
-2
我使用以下方法。
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.");
}
希望有帮助
于 2018-01-08T06:06:08.903 回答
-2
yes,yes, because there is a plugin or code that can directly help you check if the App is already in place.
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.");
}
于 2018-01-08T06:09:55.697 回答