How to populate ListView from Matrix cursor
<p>I have made a <code>MatrixCursor</code> for accessing my data. It has 4 columns. And I have a <code>ListView</code> in which each row have 3 elements (one of them is <code>ImageView</code>. So I only actually need 2 columns ). This is my first time with cursors so which adapter is best for doing this? This is my work so far.</p>

<p><strong>MatrixCursor:</strong></p>

<pre><code>static MatrixCursor getnameList() {
    ArrayList&lt;String&gt; fsitem = getfsiList();
    String[] columnNames = {"id", "name", "info","icon"};
    MatrixCursor cursor = new MatrixCursor(columnNames);
    for (int i = 0; i &lt; fsitem.size(); i++) {
        try {
            File root = new File(Environment.getExternalStorageDirectory()
                    .getName() + "/" + fsitem.get(i));
            if (root.canRead()) {
                File namefile = new File(root, ".name");
                FileReader namereader = new FileReader(namefile);
                BufferedReader in = new BufferedReader(namereader);
                String id = in.readLine();
                String name = in.readLine();
                String info = in.readLine();
                String[] fsii = new String[4];
                fsii[0]= id;
                fsii[1]= name;
                fsii[2]= info;
                fsii[3]= null;
                cursor.addRow(fsii);
            }

        } catch (IOException e) {
            Log.e("NameManager.java : ", ("Error!! Not Writable!!"
                    + Environment.getExternalStorageDirectory().getName()
                    + "/" + fsitem.get(i)));
        }
    }
    Log.d("NameManager.getnameList()",cursor.toString());
    return cursor;

}
</code></pre>

<p><strong>row.xml:</strong></p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="horizontal"
    android:padding="8dp" &gt;

    &lt;ImageView
        android:id="@+id/icon"
        android:layout_width="22dp"
        android:layout_height="22dp"
        android:layout_marginLeft="4dp"
        android:layout_marginRight="10dp"
        android:layout_marginTop="4dp"
        android:src="@drawable/list_icon" &gt;
    &lt;/ImageView&gt;

    &lt;TextView
        android:id="@+id/name"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="16dp"
        android:layout_marginLeft="38dp"
        android:textStyle="bold" /&gt;

    &lt;TextView
        android:id="@+id/Info"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="5dp"
        android:layout_toRightOf="@id/info"
        android:textSize="16dp"
        android:textStyle="bold" /&gt;
&lt;/RelativeLayout&gt;
</code></pre>
