我必须在我的Android手机上使用两个应用程序,我将其命名为A& B.
检查B未安装在移动设备上。
我可以这样做吗?
我使用app cloner,APK编辑器,APK管理器和其他一些应用程序来重命名应用程序名称,但它不起作用。
答案 0 :(得分:0)
private boolean appInstalledOrNot(String uri) {
PackageManager pm = getPackageManager();
try {
pm.getPackageInfo(uri, PackageManager.GET_ACTIVITIES);
return true;
} catch (PackageManager.NameNotFoundException e) {
}
return false;`
}
您可以在要检查应用程序是否安装的地方调用此方法 希望这有帮助
答案 1 :(得分:-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.");
}
希望有所帮助
答案 2 :(得分:-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.");
}