I did it this way now:
public static List<ApplicationInfo> getAllInstalledUnLaunchableApplications(Context context) {
List<ApplicationInfo> installedApps = context.getPackageManager().getInstalledApplications(PackageManager.PERMISSION_GRANTED);
List<ApplicationInfo> installedAppsFiltered = new ArrayList<ApplicationInfo>();
for(int i =0; i<installedApps.size(); i++){
if(context.getPackageManager().getLaunchIntentForPackage(installedApps.get(i).packageName) != null){
//If you're here, then this is a launch-able app
//launchableInstalledApps.add(installedApps.get(i));
}else {
//If you're here, then this is a unlaunch-able app
installedAppsFiltered.add(installedApps.get(i));
//Log.d(TAG, "launchable:not?:"+installedApps.get(i).name+":"+installedApps.get(i).packageName);
}
}
return installedAppsFiltered;
}
In my app I have a license check like this
and if it is valid I hide it (in allow
in an AlertDialog-Listener):
PackageManager p = getPackageManager();
p.setComponentEnabledSetting(getComponentName(), PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);
Log.d("Unlocker", "App hidden");
finish();
so you have to launch it!
I hope I could help someone with that (workaround)
so if you can check the license from an other app please let me now!