i am trying to list down the applications installed by the user and its icons. so far i managed to get the user installed applications but i am having trouble putting it in the list with the application name and icon together.
Eg row of the list:: {icon} test_application
activity
ArrayList<String> listing = null;
listing = new ArrayList<String>();
ArrayList<Object> icons = new ArrayList<Object>();
CharSequence c = null;
int count = 0;
Drawable icon = null;
super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    TextView i = (TextView) findViewById(R.id.textView1);
    PackageManager pm = getPackageManager();
    List<ApplicationInfo> packages = pm
            .getInstalledApplications(PackageManager.GET_META_DATA);
    for (ApplicationInfo applicationInfo : packages) {
        if ((applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 1) {
            count = count + 1;
            try {
                c = pm.getApplicationLabel(pm.getApplicationInfo(
                        applicationInfo.processName,
                        PackageManager.GET_META_DATA));
                icon = pm.getApplicationIcon(applicationInfo.packageName);
            } catch (NameNotFoundException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
            listing.add(c.toString());
icons.add(icon)
        }
    }
    ListView list = (ListView) findViewById(R.id.listView1);
    list.setAdapter(new ArrayAdapter<String>(this, R.layout.text, R.id.textView1, listing));
    String Counting = String.valueOf(count);
    i.setText(Counting);
}
}
xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >
    <TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true"
        tools:context=".MainActivity" />
    <ListView
        android:id="@+id/listView1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_alignParentTop="true" >
    </ListView>
</RelativeLayout>
row xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >
    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        />
    <TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_toRightOf="@+id/imageView1"
        />
    <TextView
        android:id="@+id/textView2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignBottom="@+id/imageView1"
        android:layout_toRightOf="@+id/textView1"
        android:text="TextView" />
</RelativeLayout>
 
     
    