更新时间:2023-12-01 22:49:46
只需检查您的代码:
ImageView viewBitmap = (ImageView) findViewById(R.id.icon2);
viewBitmap.setImageBitmap(bitmap);
setContentView(R.layout.open_pic_layout);
您已在设置内容视图之前编写了findViewById().是错的.
You have written findViewById() before setting Content View. Its wrong.
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.open_pic_layout);
// do your operations here
}