Make a custom listview
<p>I'm going to make a custom <code>ListView</code> with icon and label of applications installed on Android device I made some code but I don't know why when I run the application my <code>ListView</code> is empty here is the codes :</p>

<pre><code>public class MainActivity extends Activity {

ArrayList&lt;String&gt; AppLabel = new ArrayList&lt;String&gt;();
ArrayList&lt;Drawable&gt; AppIcon = new ArrayList&lt;Drawable&gt;();

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    final ListView MyListView = (android.widget.ListView) findViewById(R.id.listView1);
    EditText MyEditText = (android.widget.EditText) findViewById(R.id.textView1);
    CustomAdapter Adapter = new CustomAdapter(this, android.R.layout.simple_list_item_multiple_choice,
    MyEditText, AppLabel);
    MyListView.setAdapter(Adapter);




   PackageManager pm = this.getPackageManager();
   List&lt;ApplicationInfo&gt; apps = pm.getInstalledApplications(0);

    for(ApplicationInfo app : apps) {

    String Label = (String)pm.getApplicationLabel(app);
    AppLabel.add(Label);


    Drawable Icon = pm.getApplicationIcon(app);     
    AppIcon.add(Icon);
       }//End for

    Adapter.notifyDataSetChanged();

}//end onCreate


class CustomAdapter extends ArrayAdapter&lt;string&gt;{
public CustomAdapter(Context context, int resource,
            EditText myEditText, ArrayList&lt;String&gt; appLabel) {
        super(context, resource);
        }
public View getView(int position, View convertView, ViewGroup parent) {
    View row = convertView;
    if (row==null) {
        LayoutInflater Inflater = getLayoutInflater();
        row = Inflater.inflate(R.layout.item_layout, parent, false);    
    }//End if
    EditText MyEditText = (android.widget.EditText) findViewById(R.id.textView1);
    MyEditText.setText(AppLabel.get(position));
    ImageView MyImageView = (ImageView) findViewById(R.id.imageView1);
    MyImageView.setImageDrawable(AppIcon.get(position));
    return (row);
    }//End get view
  }//End CustomAdapter Class

 }//end Main Class
</code></pre>
