@Override
protected void onResume() {
super.onResume();
boolean installed = false;
while (!installed) {
installed = appInstalledOrNot (APPPACKAGE);
if (installed) {
Toast.makeText(this, "App installed", Toast.LENGTH_SHORT).show ();
}
}
}
private boolean appInstalledOrNot (String uri) {
PackageManager pm = getPackageManager();
boolean app_installed = false;
try {
pm.getPackageInfo(uri, PackageManager.GET_ACTIVITIES);
app_installed = true;
} catch (PackageManager.NameNotFoundException e) {
app_installed = false;
}
return app_installed;
}