Application stopped working unexpectedly. Please try again
<p>I am trying to display the name and number of a contact from android phone book, i have one contact stored in my AVD. can anyone tell me whats wrong with this code please...it is showing application stopped working Please try again...thanks in advance...</p>

<pre><code>public class get extends Activity {
        private void getColumnData(Cursor cur)
    {
        if(cur.moveToFirst())
        {
            int numi=cur.getColumnIndex(People.NUMBER);
            int namei=cur.getColumnIndex(People.NAME);
            String name,num;
            do{
                name=cur.getString(namei);
                num=cur.getString(numi);

            }while(cur.moveToNext());
        }
    }
    @Override

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Uri u=People.CONTENT_URI;
        String[] proj=new String[]{People.NAME,People.NUMBER};
        Cursor cur=managedQuery(u, proj, null, null, null);
        getColumnData(cur);
        TextView tv=new TextView(this);
        tv.setText("First step");
        setContentView(tv);
    }
}
</code></pre>
