Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. public class AppList extends Activity {
  2.  
  3. @Override
  4. public void onCreate(Bundle savedInstanceState) {
  5. super.onCreate(savedInstanceState);
  6. PackageManager pm = this.getPackageManager();
  7.  
  8. Intent intent = new Intent(Intent.ACTION_MAIN, null);
  9. intent.addCategory(Intent.CATEGORY_LAUNCHER);
  10.  
  11. List list = pm.queryIntentActivities(intent, PackageManager.PERMISSION_GRANTED);
  12. for (ResolveInfo rInfo : list) {
  13. Log.w("Installed Applications", rInfo.activityInfo.applicationInfo.loadLabel(pm).toString());
  14. }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement