I've followed this tutorial to get a gridview that displays images using a custom adapter: http://www.mkyong.com/android/android-gridview-example/
I've adapted the code to show the images when an nfc card is presented to the phone, however if I present the card multiple times, the images in the gridview are just replaced. I wanted it so that when the phone reads the nfc card again, it adds the images to the gridview, instead of just replacing them.
How can I achieve this?
//If the NFC card contains the word "pic"
if(thePayloadText.equals("pic")){
gridView = (GridView) findViewById(R.id.gridView1);
gridView.setAdapter(new ImageAdapter(this, MOBILE_OS));
}
//If the NFC card contains the word "test"
if(thePayloadText.equals("test")){
gridView = (GridView) findViewById(R.id.gridView1);
gridView.setAdapter(new ImageAdapter(this, PHOTOS));
}