-3
我想從第二個活動imageView拍攝圖片並將其放入MainActivity imageView中。如何把它?希望我的代碼是正確的。如何將圖像從一個ImageView截取到另一個ImageView
主要活動
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (resultCode == RESULT_OK) {
switch (requestCode) {
case REQUEST_CODE_PLAYER1:
String name1 = data.getStringExtra("name");
playerName1.setText(name1);
btnPlayer1.setImageResource(Integer.parseInt("photo"));
次活動
公共無效的onClick(視圖v){
Intent intent = new Intent();
switch (v.getId()) {
case R.id.axe:
intent.putExtra("name", axeName.getText().toString());
intent.putExtra("photo", R.drawable.axe);
break;
您的意思是得到圖片的drawable?或從整個第二個活動中獲取圖像? – SiSa
請不要使用代碼圖片(尤其是託管在外部網站上) - 請將其複製/粘貼到您的問題中。這將使問題更容易回答,對於未來找到答案的人更有用。 – Jonathan