我在Dialog上遇到NullPointerException。这是我的代码:
@Override
public boolean onDoubleTap(MotionEvent e) {
Toast.makeText(getApplication(), "test lang ito! ", Toast.LENGTH_SHORT).show();
Dialog d = new Dialog(getApplicationContext());
d.setContentView(R.layout.popup_image);
ImageView imageView = (ImageView)findViewById(R.id.image);
imageView.setImageResource(resid[0]);
d.show();
return false;
}
在这一行:imageView.setImageResource(resid[0]);
答案 0 :(得分:1)
没有渣油很难说,但渣油是否为空?渣油中有多少元素? imageView是否为null?