Retrieve bitmap from uri

前端 未结 7 1746
终归单人心
终归单人心 2021-01-01 17:06

I have included \'share via myApp\' option. I inserted following code in the receiving activity class.

    // Get the intent that started this activity
    I         


        
7条回答
  •  一个人的身影
    2021-01-01 17:48

    You can try this. You can call setPic() in onActivityResult method. I have used this in an application to take photos an put it in an ImageView.

    private void setPic() {
    
        //currentPhotoPath contains path of image file.
        //visorFoto is a reference to an ImageView object.
        File file = new File(currentPhotoPath);
        Uri imageUri = Uri.fromFile(file);
        visorFoto.setImageURI(imageUri);
    
    }
    

提交回复
热议问题