title: android studio how to print list of installed apps into a listView
body: <p>I've found some code on the internet to obtain details of currently installed apps, I'm not sure how to implement this into a list. I've created the list in the xml file but I'm not too sure how to implement the data into the listView. The code to obtain the app data is -</p>
  
  <pre><code>     final Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
    mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);
    final List pkgAppsList = getPackageManager().queryIntentActivities(      mainIntent, 0);
    for (Object object : pkgAppsList) 
    {
  ResolveInfo info = (ResolveInfo) object;
  Drawable icon    = getBaseContext().getPackageManager().getApplicationIcon(info.activityInfo.applicationInfo);
  String strAppName   = info.activityInfo.applicationInfo.publicSourceDir.toString();
  String strPackageName  = info.activityInfo.applicationInfo.packageName.toString();
  final String title  = (String)((info != null) ? getBaseContext().getPackageManager().getApplicationLabel(info.activityInfo.applicationInfo) : "???");
  </code></pre>
  
  <p>}</p>