-3

I want to extract the games only

Code

private void loadApps(){
    manager = getPackageManager();
    apps = new ArrayList<AppDetail>();

    Intent i = new Intent(Intent.ACTION_MAIN, null);

    i.setType("Games");
    List<ResolveInfo> availableActivities = manager.queryIntentActivities(i, 0);
    for(ResolveInfo ri:availableActivities){
        AppDetail app = new AppDetail();
        app.label = ri.loadLabel(manager);
        app.name = ri.activityInfo.packageName;
        app.icon = ri.activityInfo.loadIcon(manager);
        apps.add(app);
    }
}
Alex Salauyou
  • 14,185
  • 5
  • 45
  • 67

1 Answers1

1

You can't. There's no distinction between "apps" and "games".

Marcin Orlowski
  • 72,056
  • 11
  • 123
  • 141