Note that there are some explanatory texts on larger screens.

plurals
  1. POAttach an image to a contact
    primarykey
    data
    text
    <p>I am having exactly the same problem as described <a href="https://code.google.com/p/android/issues/detail?id=4175" rel="nofollow">here</a>.</p> <p>I am trying to use this Intent: <code>android.provider.ContactsContract.Intents.ATTACH_IMAGE</code></p> <p><code>Starts an Activity that lets the user pick a contact to attach an image to.</code><br> Sounds suitable to me but unfortunately results in an <code>ActivityNotFoundException</code>.</p> <p>Code: </p> <pre><code>import android.provider.ContactsContract; ... try { Intent myIntent = new Intent(); myIntent.setAction(ContactsContract.Intents.ATTACH_IMAGE); myIntent.setData(imageUri); startActivity(myIntent); } catch (ActivityNotFoundException anfe) { Log.e("ImageContact", "Firing Intent to set image as contact failed.", anfe); showToast(this, "Firing Intent to set image as contact failed."); } </code></pre> <p>I cannot find any error in the code above. The <code>imageUri</code> is correct for following code is working perfectly:</p> <p>Code: </p> <pre><code>try { Intent myIntent = new Intent(); myIntent.setAction(Intent.ACTION_ATTACH_DATA); myIntent.setData(imageUri); startActivity(myIntent); } catch (ActivityNotFoundException anfe) { Log.e("ImageContact", "Firing Intent to set image as contact failed.", anfe); showToast(this, "Firing Intent to set image as contact failed."); } </code></pre> <p>As mentioned in the link this results in a another menu before getting to the contacts. That is acceptable but not perfect.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload