I have a working note-taking app currently using a listview. I want the user to be able to switch to a gridview. The switch is not the problem as I could just load a different layout file with the different view, but I want their current notes in the listview to be transferred over to the gridview notes upon the switch. Is there a way to access each notes contents using a for each loop and then add the contents to the gridview using something like
Something I have done before that I know works is to put your data into a
RecyclerView and switch the layout manager between a
LinearLayoutManager and a
GridLayoutManager. The adapter doesn't change so the data isn't affected. The adapter can have different view types based on the current layout manager.