I want to make a list of both installed and system applications separately.Below is my code
List<ApplicationInfo> appList = packageManager.getInstalledApplications(0);
if(appList != null && !appList.isEmpty()){
for (ApplicationInfo appInfo : appList) {
Intent intent = packageManager.getLaunchIntentForPackage(appInfo.packageName);
if(intent != null){
ComponentName componentName = intent.getComponent();
if((appInfo.flags & ApplicationInfo.FLAG_SYSTEM) == 1) {
//It is a system app
}else{
//It is an installed app.
}
}
}
}
I want to launch each app on click of listview.But the componentName .getClassName() shows as "com.android.internal.app.ResolverActivity" for some applications like Contacts,Map etc....How can i get exact class name of such type of applications.I could not use ResolveInfo because it is difficult to categorize applications.
How to get exact class name of applications using package name ?
Thanks in Advance