阅读背景:

在android中添加一个png到剪贴板

来源:互联网 

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);
        File



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: