Skip to content Skip to sidebar Skip to footer

Cursor Cursor = Managedquery(intent.getdata().... Nullpointerexception

i have code with error public void runIntent() { Intent intent = new Intent(Intent.ACTION_PICK,ContactsContract.Contacts.CONTENT_URI); startActivityFor

Solution 1:

try this..it will work for you

public void runIntent()
{
     Intent intent = new
Intent(Intent.ACTION_PICK,ContactsContract.Contacts.CONTENT_URI);
     startActivityForResult(intent, 1);

}
public void onActivityResult(int requestCode, int resultCode, Intent intent) 
{

           if (resultCode == RESULT_OK) {
            getContactInfo(intent); 
            Log.e("RESULT_OK","Ok");
           }else
           {
               Log.e("RESULT_OK","Error");
           }
}

Post a Comment for "Cursor Cursor = Managedquery(intent.getdata().... Nullpointerexception"