Code example for ArrayList

0
  private class IntentAdapter extends BaseAdapter {
        private final List<CharSequence> mNames;
        private final Map<CharSequence, Intent> mIntents;
 
        IntentAdapter() { 
            mNames = new ArrayList<CharSequence>();
            mIntents = new HashMap<CharSequence, Intent>();
        } 
 
        void refresh() { 
            mNames.clear();
            mIntents.clear();
 
            final Intent mainIntent = new Intent(ACTION_MAIN, null);
            mainIntent.addCategory("com.actionbarsherlock.sample.knownbugs." + mCategory);
 
            PackageManager pm = getPackageManager();
            final List<ResolveInfo> matches = pm.queryIntentActivities(mainIntent, 0);
            for (ResolveInfo match : matches) {
                Intent intent = new Intent();
                intent.setClassName(match.activityInfo.packageName, match.activityInfo.name);