app not working on emulator
<p>I am a beginner in android app development.I am trying to make an app that accesses the contacts from the phone.My console shows succesful installation of the app but it doesn't get started in the emulator.Could anyone please tell me what could be the possible reasons??</p>

<pre><code>import java.util.ArrayList;
import android.app.Activity;
import android.content.ContentResolver;
import android.database.Cursor;
import android.os.Bundle;
import android.provider.ContactsContract;
import android.provider.ContactsContract.CommonDataKinds.Email;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ListView;

public class MainActivity extends Activity    { 
ListView lvItem;
private Button btnAdd;
String displayName="", emailAddress="", phoneNumber="";
ArrayList&lt;String&gt; contactlist=new ArrayList&lt;String&gt;();
ArrayAdapter&lt;String&gt; itemAdapter;


@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
   lvItem = (ListView)this.findViewById(R.id.listView_items);  
   btnAdd = (Button)this.findViewById(R.id.btnAddItem);
   itemAdapter = new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1,contactlist);
   lvItem.setAdapter(itemAdapter);
   btnAdd.setOnClickListener(new View.OnClickListener() {
       public void onClick(View v) {
           readContacts();
       }
   });
}

private void readContacts()
{
    ContentResolver cr =getContentResolver();
    Cursor cursor = cr.query(ContactsContract.Contacts.CONTENT_URI, null, null, null, null);
    while (cursor.moveToNext()) 
    {
        displayName="";emailAddress=""; phoneNumber="";
        displayName = cursor.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME));       
        String id = cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts._ID));
        Cursor emails = cr.query(Email.CONTENT_URI,null,Email.CONTACT_ID + " = " + id, null, null);
        while (emails.moveToNext()) 
        { 
            emailAddress = emails.getString(emails.getColumnIndex(Email.DATA));
            break;
        }
        emails.close();
        if(Integer.parseInt(cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts.HAS_PHONE_NUMBER))) &gt; 0)
        {
            Cursor pCur = cr.query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI,null,ContactsContract.CommonDataKinds.Phone.CONTACT_ID +" = ?",new String[]{id}, null);
            while (pCur.moveToNext()) 
            {
                 phoneNumber = pCur.getString(pCur.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));
                break;
            }
            pCur.close();
        }
            contactlist.add("DisplayName: "+displayName+", PhoneNumber: "+phoneNumber+", EmailAddress: "+ emailAddress+"\n");
            itemAdapter.notifyDataSetChanged();
    }
    cursor.close(); 
}
</code></pre>

<p>}</p>

<p>manifest.xml</p>

<pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
    &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.example.contacts"
        android:versionCode="1"
        android:versionName="1.0" &gt;
        &lt;uses-sdk
           android:minSdkVersion="8"
           android:targetSdkVersion="17" /&gt;
    &lt;uses-permission android:name="android.permission.READ_CONTACTS" /&gt;
        &lt;application
            android:allowBackup="true"
            android:icon="@drawable/ic_launcher"
            android:label="@string/app_name"
            android:theme="@style/AppTheme" &gt;
            &lt;activity
               android:name="com.example.contacts.MainActivity"
               android:label="@string/app_name" &gt;
               &lt;intent-filter&gt;
                    &lt;action android:name="android.intent.action.MAIN" /&gt;
                    &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
               &lt;/intent-filter&gt;
            &lt;/activity&gt;
        &lt;/application&gt;
&lt;/manifest&gt;
</code></pre>
