2010-05-25 75 views
0

我在Main.xml中有Imagebutton或圖像視圖如何將圖像Capture的結果URI分配給ImageView或ImageButton?

如何將結果URI分配給ImageView或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"); 
       startActivityForResult(intent, 0); 


      } 

回答

2

很簡單

mPhotoView.setImageURI(uri); 
相關問題