0

I've used a viewflipper xml as row xml for viewlist , but when I touch on any viewitemlist just the top item on screen flips! I know it's because they have same ID (it's like having multiple ViewFlipper with same id on a layout).

I've used SimpleCursorAdapter() to create my listview (in Activity not ListActivity).

    public void onClick(View v) {
        ViewFlipper vf = (ViewFlipper) findViewById(R.id.viewFlipper);
        switch (v.getId()) {

        case R.id.viewFlipper:
            vf.showNext();
            break;
            .
            .
            .
        }
    }

I've tried OnItemClickListener() too (same result).

NewDev
  • 21
  • 1
  • Could you show us the line where you create and set up the `SimpleCursorAdapter()`. Thanks. – Tom Oct 08 '13 at 12:30
  • `adapter = new SimpleCursorAdapter(this, R.layout.row, cursor, FROM, TO, 0);` – NewDev Oct 08 '13 at 13:58
  • Hey NewDev, now I find `SimpleCursorAdapter()` quite annoying because it takes a lot of control away from developers. The cost for "easyness" is difficulty adding functionality down the line. If you do wish to use this, have a read of `ViewBinder` http://developer.android.com/reference/android/widget/SimpleCursorAdapter.ViewBinder.html . You should then set the click listener on the view each time afterwards. This way you don't have to use `findViewById` inside the click listener. – Tom Oct 08 '13 at 15:00
  • Thanks. I've used `ViewBinder` for changing and modifying data but how to use it for `onClickListener`? – NewDev Oct 09 '13 at 15:17

1 Answers1

0

Please see below link answer to get information about list view with view flipper implementation.

https://stackoverflow.com/a/44106602/651377

Community
  • 1
  • 1
Alok Gupta
  • 1,806
  • 22
  • 21