开发者

How can i assign result URI from image Capture to ImageView or ImageButton?

开发者 https://www.devze.com 2022-12-31 19:36 出处:网络
I haveImagebuttonorimageview in Main.xml How can i assign result URI to ImageView or ImageButton? public void onActivityResult(int requestCode, int resultCode, Intent data) {

I have Imagebutton or image view in Main.xml

How can i assign result URI to ImageView or ImageButton?

public void onActivityResult(int requestCode, int resultCode, Intent data) {

  if (resultCode == Activity.RESULT_OK && requestCode == 0) {
    String result = data.toURI();
}

}


public void onClick(DialogInterface arg0, int arg1) {

                Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
                startActi开发者_如何学GovityForResult(intent, 0);


            }


It's simple

mPhotoView.setImageURI(uri);
0

精彩评论

暂无评论...
验证码 换一张
取 消