Note that there are some explanatory texts on larger screens.

plurals
  1. POset imageView's image to contact photo
    primarykey
    data
    text
    <p>Want to set photo from imageView to contact photo. I am trying this,but I get an exception.Here is my code :</p> <pre><code> draw.btnSetAs.setOnClickListener(new View.OnClickListener() { public void onClick(View v){ Context context= getApplicationContext(); Bitmap icon= BitmapFactory.decodeResource(context.getResources(), R.id.viwer_photo3); try { Intent myIntent = new Intent(); myIntent.setAction(ContactsContract.Intents.ATTACH_IMAGE); myIntent.putExtra(Intent.EXTRA_STREAM, icon); startActivity(myIntent); } catch (ActivityNotFoundException anfe) { Log.i("ImageContact", "Firing Intent to set image as contact failed.", anfe); } } }); </code></pre> <p>I am getting this exception:</p> <pre><code>06-16 14:25:34.431: INFO/ImageContact(1708): Firing Intent to set image as contact failed. 06-16 14:25:34.431: INFO/ImageContact(1708): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=com.android.contacts.action.ATTACH_IMAGE (has extras) } 06-16 14:25:34.431: INFO/ImageContact(1708): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1567) 06-16 14:25:34.431: INFO/ImageContact(1708): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1537) 06-16 14:25:34.431: INFO/ImageContact(1708): at android.app.Activity.startActivityForResult(Activity.java:2858) 06-16 14:25:34.431: INFO/ImageContact(1708): at android.app.Activity.startActivity(Activity.java:2964) 06-16 14:25:34.431: INFO/ImageContact(1708): at com.aragast.display.FullScreenImageActivity$4.onClick(FullScreenImageActivity.java:143) 06-16 14:25:34.431: INFO/ImageContact(1708): at android.view.View.performClick(View.java:2408) 06-16 14:25:34.431: INFO/ImageContact(1708): at android.view.View$PerformClick.run(View.java:8817) 06-16 14:25:34.431: INFO/ImageContact(1708): at android.os.Handler.handleCallback(Handler.java:587) 06-16 14:25:34.431: INFO/ImageContact(1708): at android.os.Handler.dispatchMessage(Handler.java:92) 06-16 14:25:34.431: INFO/ImageContact(1708): at android.os.Looper.loop(Looper.java:144) 06-16 14:25:34.431: INFO/ImageContact(1708): at android.app.ActivityThread.main(ActivityThread.java:4937) 06-16 14:25:34.431: INFO/ImageContact(1708): at java.lang.reflect.Method.invokeNative(Native Method) 06-16 14:25:34.431: INFO/ImageContact(1708): at java.lang.reflect.Method.invoke(Method.java:521) 06-16 14:25:34.431: INFO/ImageContact(1708): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) 06-16 14:25:34.431: INFO/ImageContact(1708): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) </code></pre> <p>And I can't understand whats the problem.<br> Thanks</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.
    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