how to show the data in list using cursor in android
<p>I am getting the from the database using cursor but when i am trying to show the data in list, it is not showing..</p>

<p>the below code is for accessing the data using cursor from database:</p>

<pre><code>protected void showCustomerdetails() {

    try
    {
        Cursor cursor = m_dbManager.getValues("customer", new String[]{"name","mobile_phone" }, null, null, null, null);
        if(cursor != null)
        {
            cursor.moveToFirst();
            int i = 0;
            while(cursor.isAfterLast() == false)
            {
                m_uname = cursor.getString(cursor.getColumnIndex("name"));
                Log.d("debug","getting the name from cursor");
                m_mobnum = cursor.getString(cursor.getColumnIndex("mobile_phone"));
                cursor.moveToNext();
                i++;
            }
        }
        cursor.close();
    }
    catch(SQLException e)
    {
        e.printStackTrace();
    }
}
</code></pre>

<p>now the below code is for adding the data in the list---</p>

<pre><code>class IconicAdapter extends ArrayAdapter&lt;String&gt; 
{   
 Activity context;   
 IconicAdapter(Activity context) 
 {   
     super(context, R.layout.custoemrs_list);   
     this.context=context;   
 }   

 public View getView(int position, View convertView, ViewGroup parent) 
 {  
    View row = null;
    try
    {
            LayoutInflater inflater=context.getLayoutInflater();   
            row=inflater.inflate(R.layout.custoemrs_list, null);
            TextView des=(TextView)row.findViewById(R.id.custusername);   
            des.setText(m_uname);

            TextView qty=(TextView)row.findViewById(R.id.custmobnum);
            qty.setText(m_mobnum);



    }
    catch(Exception e)
    {
        e.printStackTrace();
    }
    return row;
 }
}
</code></pre>
