Android OnClickListener NullPointerException
all. I've searched, but can't find anything that helps me fix this problem. My app quits almost immediately on launch due to a NullPointerException. I suspect maybe the problem is
Solution 1:
blankTile = (ImageView) findViewById(R.drawable.blank);
you can not use R.drawable to retrieve items. You have to use R.id
Solution 2:
To get Id of View,use R.id instead of R.drawable,So change
blankTile = (ImageView) findViewById(R.drawable.blank);
to
blankTile = (ImageView) findViewById(R.id.blank);
And set drawable using blankTile.setImageResource(R.drawable.zero);
Post a Comment for "Android OnClickListener NullPointerException"