I have an activity with a list whose elements are made of image + text. I need to allow the user to change the view and instead have a gridview (whose elements are still made from the same image + text).
The user can do this through the icon menu:
public boolean onOptionsItemSelected(MenuItem item) { if(item.getItemId()== R.id.change_view) {
I tried just installing a new adapter (see below), but it does not work. Do I need to create a new action for this?
if(item.getItemId()== R.id.change_view) { setContentView(R.layout.grid_view); gridViewAdapter = new GridViewAdapter(this,R.layout.bookmark_list_item,MyApp.getItems().findAll()); list.setAdapter(gridViewAdapter); list.setVisibility(View.VISIBLE); }
android listview gridview
Segfault
source share