I’m getting a NullPointerException on my Dialog. Here’s my code:
@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;
}
in this line: imageView.setImageResource(resid[0]);
I imagine you want to look for the
ImageViewin the dialog layout, but you are looking in your Activity layout.Try using
instead and see if that fixes it.