-2
ImageButton(メインアクティビティ)のイメージを他のアクティビティから変更しようとしています。
他のアクティビティは、ImageButtonが
を押したときにポップアップするダイアログなので、Canvasを使用しているユーザーから線を引いてサインを得ることができます。
ビットマップを取得しましたが、設定しようとするとクラッシュしました。
なぜこのようなことが起こるのか説明できる人はいますか?ImageViewの画像を他のアクティビティからどのように変更できますか?
final ImageButton imageButton = (ImageButton)findViewById(R.id.sign);
//this 'sign' button is actually in Main Activity. not this class. Does this make problem?
dv = new DrawingView(this);
Button confirm = new Button(this);
confirm.setText("confirm");
confirm.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
imageButton.setImageBitmap(dv.getBitmap());
finish();
}
});
感謝の私の多くを取ることを! – Yanguun