本文介绍了从uri检索位图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我加入了通过myApp共享"选项.我在接收活动类中插入了以下代码.
I have included 'share via myApp' option. I inserted following code in the receiving activity class.
// Get the intent that started this activity Intent intent = getIntent(); Uri data = intent.getData(); // Figure out what to do based on the intent type if (intent.getType().indexOf("image/") != -1) { // Handle intents with image data ... }检索位图图像的下一步是什么.
What is the next step to retrieve bitmap image.
推荐答案您已经获得了Uri.现在,您必须在getBitmap()中传递该Uri以获得位图并使用该位图.
As you have already get the Uri. Now you have to pass that Uri in getBitmap() to get bitmap and use that bitmap.
Uri imageUri = intent.getData(); Bitmap bitmap = MediaStore.Images.Media.getBitmap(this.getContentResolver(),imageUri); Imageview my_img_view = (Imageview ) findViewById (R.id.my_img_view); my_img_view.setImageBitmap(bitmap);更多推荐
从uri检索位图
发布评论