Adding a png to clipboard in android -
i have 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 path in clipboard
not image
itself, think must possible see image
because when take screenshot see image in clipboard. maybe it's bitmap if know how pass bitmap clipboard please tell. if 1 can suggest solution thankful.
android clipboard works different counterparts mac os pasteboard , windows's clipboard. mac , windows approach physically store contents image/binary, rtf, file references, etc., data can shared within system. android clipboard can store text (and can deal html since jelly bean). other types represented content provider uri pointing actual data. job of app receiving uri retrieve contents (via contentresolver) , treat incoming data accordingly.
Comments
Post a Comment