1

I need to display my data in 2 different modes: medium and large view. I have a custom adapter and display data into listview. when i click on list view item i start a new activity. With on layout in my adapter everything works perfect. Now i try to switch between two layouts in adapter: i set to the adapter view mode and then call notifyDataSetChanged:

    ticketsAdapter.setViewMode(ViewMode.Large);
    ticketsAdapter.notifyDataSetChanged();

this also work and now i can see more information (large row layout has more field than medium view). The problem is that alter this click on listview items it's not working anymore. In getView method from my adapter i do somethink like this:

LayoutInflater li = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        switch (viewMode) {
        case Large:
            v = li.inflate(R.layout.row_large, null);
            break;
        case Medium:
            v = li.inflate(R.layout.row_medium, null);
            break;
        default:
            v = li.inflate(R.layout.row_medium, null);
            break;
        }

Can some one help?

Fixed:

I had one textview with:

android:inputType="text"

and this caused the problem. Tx

cmg_george
  • 309
  • 1
  • 2
  • 9

0 Answers0