In the gridlayout there are nine imageview in which some of the imageview image are drawn in a method.Now I want to remove the already drawn image in imageview in another method.I tried this but the app crashes.
GridLayout gridLayout = (GridLayout)findViewById(R.id.gridLayout);
for (int i = 0; i< gridLayout.getChildCount(); i++) {
((ImageView) gridLayout.getChildAt(i)).setImageResource(0);