I want to launch a specif application.
I know how to do Intents but I want to avoid the selection menu if there are multiple apps that can handle the intent, I want
I've resolved issue by
String packageName = "Your package name";
Intent intent = getPackageManager().getLaunchIntentForPackage(packageName);
if(intent == null) {
try {
// if play store installed, open play store, else open browser
intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + packageName));
} catch (Exception e) {
intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + packageName));
}
}
startActivity(intent);