Code example for ArrayList

  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() { 
            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();
Connect your IDE to all the code out there  Get Codota for Java