Update And Remove GridView Items At Runtime
i am developing a project where i compare the images of two items,So if two items will have same image after clicking these items should be hide. my code is given below and this co
Solution 1:
You have
final ImageView myimage = new ImageView(ctx);
ctz
is not initialized. Its only declared as Context ctx
;
You have this
gridView.setAdapter(adapter);
But you need to intialize adapter
before using the same
So change to
setContentView(R.layout.main);
final ImageView myimage = new ImageView(this); //this refers to Activity context
gridView = (GridView) findViewById(R.id.gv_memory);
adapter = new ImageAdapter(this)
gridView.setAdapter(adapter);
Post a Comment for "Update And Remove GridView Items At Runtime"