Retrieve bitmap from uri

前端 未结 7 1744
终归单人心
终归单人心 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:36

    This is work for me

    protected void onActivityResult(int requestCode, int resultCode, Intent data)
    {
    super.onActivityResult(requestCode, resultCode, data);
    if (resultCode == RESULT_OK)
    {
        Uri imageUri = data.getData();
        Bitmap bitmap = MediaStore.Images.Media.getBitmap(this.getContentResolver(), imageUri);
    }
    }
    

提交回复
热议问题