Calling "startActivityForResult" successfully, but crashing after the activity and before "onActivityResult"
<p>Scenario:</p>

<ul>
<li><p>1st Activity, calls my 2nd activity requesting a result as follows:</p>

<p>startActivityForResult(intent, 1008);</p></li>
<li><p>2nd Activity (with no gui, no xml file etc) starts ok</p></li>
<li><p>2nd Activity calls the contact picker requesting a result as follows:</p>

<p>Intent intent = new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI);
startActivityForResult(intent, 1001);</p></li>
<li><p>Now the contact picker runs successfully, but after picking a contact
it CRASHES!</p></li>
</ul>

<blockquote>
  <p>"The application ... has stopped unexpectedly"</p>
</blockquote>

<p>I am stuck there for hours, I have browsed stackoverflow and googled the heck out of it - How can I prevent it from crashing and get the result from the contact picker?
It doesn't get to the second application's "onActivityResult"</p>

<p>The second activity:</p>

<pre><code>@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    Intent intent = new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI);
    Toast.makeText(this, "A", Toast.LENGTH_SHORT).show();

    startActivityForResult(intent, CONTACT_PICKER_REQ_CODE);
    Toast.makeText(this, "B", Toast.LENGTH_SHORT).show();

}
</code></pre>

<p>I get the "A" and "B" toasts on the screen, and during that time see the contact picker, but after picking the contact I get the crashing message...</p>

<p>Logcat:</p>

<pre><code>02-17 15:10:39.747: E/AndroidRuntime(2303): FATAL EXCEPTION: main
02-17 15:10:39.747: E/AndroidRuntime(2303): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1001, result=-1, data=Intent { dat=content://com.android.contacts/contacts/lookup/0r2-473D433D3B2D5D5547/2 flg=0x1 (has extras) }} to activity {org.chaiware.contacts/org.chaiware.contacts.ContactInfoRetriever}: java.lang.IllegalArgumentException: the bind value at index 1 is null
02-17 15:10:39.747: E/AndroidRuntime(2303):     at android.app.ActivityThread.deliverResults(ActivityThread.java:2532)
02-17 15:10:39.747: E/AndroidRuntime(2303):     at android.app.ActivityThread.handleSendResult(ActivityThread.java:2574)
02-17 15:10:39.747: E/AndroidRuntime(2303):     at android.app.ActivityThread.access$2000(ActivityThread.java:117)
02-17 15:10:39.747: E/AndroidRuntime(2303):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:961)
02-17 15:10:39.747: E/AndroidRuntime(2303):     at android.os.Handler.dispatchMessage(Handler.java:99)
02-17 15:10:39.747: E/AndroidRuntime(2303):     at android.os.Looper.loop(Looper.java:123)
02-17 15:10:39.747: E/AndroidRuntime(2303):     at android.app.ActivityThread.main(ActivityThread.java:3683)
02-17 15:10:39.747: E/AndroidRuntime(2303):     at java.lang.reflect.Method.invokeNative(Native Method)
02-17 15:10:39.747: E/AndroidRuntime(2303):     at java.lang.reflect.Method.invoke(Method.java:507)
02-17 15:10:39.747: E/AndroidRuntime(2303):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
02-17 15:10:39.747: E/AndroidRuntime(2303):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
02-17 15:10:39.747: E/AndroidRuntime(2303):     at dalvik.system.NativeStart.main(Native Method)
02-17 15:10:39.747: E/AndroidRuntime(2303): Caused by: java.lang.IllegalArgumentException: the bind value at index 1 is null
02-17 15:10:39.747: E/AndroidRuntime(2303):     at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:144)
02-17 15:10:39.747: E/AndroidRuntime(2303):     at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:114)
02-17 15:10:39.747: E/AndroidRuntime(2303):     at android.content.ContentProviderProxy.bulkQueryInternal(ContentProviderNative.java:330)
02-17 15:10:39.747: E/AndroidRuntime(2303):     at android.content.ContentProviderProxy.query(ContentProviderNative.java:366)
02-17 15:10:39.747: E/AndroidRuntime(2303):     at android.content.ContentResolver.query(ContentResolver.java:262)
02-17 15:10:39.747: E/AndroidRuntime(2303):     at android.app.Activity.managedQuery(Activity.java:1550)
02-17 15:10:39.747: E/AndroidRuntime(2303):     at org.chaiware.contacts.ContactInfoRetriever.getContactInfo(ContactInfoRetriever.java:105)
02-17 15:10:39.747: E/AndroidRuntime(2303):     at org.chaiware.contacts.ContactInfoRetriever.onActivityResult(ContactInfoRetriever.java:49)
02-17 15:10:39.747: E/AndroidRuntime(2303):     at android.app.Activity.dispatchActivityResult(Activity.java:3908)
02-17 15:10:39.747: E/AndroidRuntime(2303):     at android.app.ActivityThread.deliverResults(ActivityThread.java:2528)
</code></pre>
