1
I’m wanting to learn how to create a list with all the apps installed from Android. How do I show in a ListView
all apps installed on the smartphone?
1
I’m wanting to learn how to create a list with all the apps installed from Android. How do I show in a ListView
all apps installed on the smartphone?
0
Following the code to get the list of activities/apps installed on Android:
final Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);
final List pkgAppsList = context.getPackageManager().queryIntentActivities( mainIntent, 0);
I hope it helped, any doubt just call.
0
Follows:
PackageManager packageManager=getPackageManager();
List<ApplicationInfo> list = packageManager.getInstalledApplications(PackageManager.GET_META_DATA);
List<String> values = new ArrayList<String>(0);
for(ApplicationInfo ap:list){
values.add(ap.packageName);
}
ListView lista = ListView.class.cast(findViewById(R.id.lista));
lista.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, values));
Browser other questions tagged android
You are not signed in. Login or sign up in order to post.
I’m ignorant on how to use this code. Do I need a program to run it? Or on mobile has a right place to run?
– LCarvalho
If you have doubts about where to put this code, your doubt is much greater than you demonstrated in the question. Start from the beginning and gradually increase your knowledge. You can’t start from the top.
– Pablo Almeida