0

I need to create dashboard using GridView. One of the items will be an item that, when clicked, will add new item to an adapter array. I need to create that one item in a way that it will not be added to the adapter array, because i.e all items will be saved to file.

Is there any way that I can add such item without adding it to adapter array of GridView?

Ryan Sayles
  • 3,389
  • 11
  • 56
  • 79
userbb
  • 2,148
  • 5
  • 30
  • 53

1 Answers1

0

Create your adapter: ArrayAdapter<(type)> adapter = new ArrayAdapter<(type)>(params) then create a button (or whatever item you are using to add values to the array) and set an onClick where you can do adapter.add(item). If you want that button (for example) to be in your GridView but not save it to a file, just have your file saver exclude position=0 which should be defined in your Adapter class.

Ryan Sayles
  • 3,389
  • 11
  • 56
  • 79