I have the following code:
File imageFile = new File(f.getAbsolutePath()); ContentValues values = new ContentValues(2); values.put(MediaStore.Images.Media.MIME_TYPE, "image/png"); values.put(MediaStore.Images.Media.DATA,imageFile.getAbsolutePath()); ContentResolver theContent = getContentResolver(); Uri imageUri = theContent.insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values); ClipData theClip = ClipData.newUri(getContentResolver(),"image", imageUri); android.content.ClipboardManager clipboard = (android.content.ClipboardManager)getSystemService(Context.CLIPBOARD_SERVICE); clipboard.setPrimaryClip(theClip);
I see only the path in the clipboard not the image itself, I think it should be possible to see the image , because when you take a screenshot, you see the image on the clipboard. Maybe this is only with a bitmap, if you know how to transfer the bitmap to the clipboard, please tell me. If anyone can suggest a solution, I will be very grateful.
source share