Note that there are some explanatory texts on larger screens.

plurals
  1. POcustom views not updating with OnGroupClickListener on ExpandableListView
    primarykey
    data
    text
    <p>I have custom groupViews that need to change state when they are expanded and collapsed. If the same group view is expanded it toggles between two states.</p> <p>The problem i'm having is that the expand method seems to be pulling up some cached version of the views because my updates aren't visible after calling expandGroup.</p> <p>If my listener returns true (handles the whole event itself) without calling expandGroup the update does happen. So something is happening with expandGroup that only allows cached view to be drawn. I have tried invalidating() just about everything. I've tried firing off data update events on the List View. i've tried all this other stuff as well:</p> <pre><code>expandableList.setGroupIndicator(null); expandableList.setAlwaysDrawnWithCacheEnabled(false); expandableList.setWillNotCacheDrawing(true); expandableList.setItemsCanFocus(false); </code></pre> <p>no luck on any of those :(</p> <p>Here's my onClick code:</p> <pre><code>expandableList.setOnGroupClickListener(new OnGroupClickListener() { public boolean onGroupClick(ExpandableListView parent, View v, int groupPosition, long id) { MusicTrackRow mt = (MusicTrackRow) v; if (mt.isPlaying == true) { mt.setPaused(); } else { mt.setPlaying(); } mt.invalidate(); parent.invalidate(); trackAdapter.notifyDataSetInvalidated(); //need to call expandGroup if the listener returns true.. if returning false expandGroup is //returned automatically expandableList.expandGroup(groupPosition); //no view refresh return true; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload