Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid ExpandableListView Strange behavior with Mouse wheel
    primarykey
    data
    text
    <p>I have implemented an ExpandableListView that uses a SimpleCursorTreeAdapter to populate the children. But I am getting some unusual behavior. Clicking on the parent causes the children to show but then I nothing else works. What this means is that I can't expand other parents or collapse children. When debugging I accidentally used the mouse scroll wheel and the ExpandableListView started fully working as expected.<br> Here is the code for the children:</p> <pre><code>private void showEvents(final Cursor cursor) { ExpandableListView lv1 = this.getExpandableListView(); lv1.setScrollbarFadingEnabled(false); SimpleCursorTreeAdapter treeAdapter = new SimpleCursorTreeAdapter (this, cursor, R.layout.simplerow, FROM, TO, R.layout.childrow, FROMCHILD, TOCHILD) { @Override public void setViewText(TextView v, String text) { super.setViewText(v, convText(v, text, cursor)); } @Override protected Cursor getChildrenCursor(Cursor parentCursor) { int groupPos = parentCursor.getPosition(); Log.d("TEST", "getChildrenCursor() for groupPos " + groupPos); String childSql = "select f._id, f.NAME as FUNDNAME, " + "f.value as AMOUNT_OWNED " + "from funds f " + "where f.asset_class = " + parentCursor.getInt(0) + ";"; Log.d("getChildrenCursor", childSql); SQLiteDatabase db = pfdata.getReadableDatabase(); Cursor assetsCursor = db.rawQuery(childSql, null); Log.d("getChildrenCursor", Integer.toString(assetsCursor.getCount())); return assetsCursor; } }; lv1.setAdapter(treeAdapter); } </code></pre> <p>Is there someone who can explain why this is happening or offer some advise? Thank you for your time.</p> <p>So I now know the line of code that causes the behavior. The activity consists of several listviews plus the expandable listview that is above. I started commenting out code and found that by removing this one line of code elsewhere in the activity, everything works fine.</p> <pre><code>RB1lv.setScrollIndicators </code></pre> <p>and it is defined a few lines up as follows:</p> <pre><code>ListView RB1lv = (ListView) findViewById(R.id.list3); </code></pre> <p>Good news is that I don't have this odd behavior anymore. But I have no idea why changing the scroll indicators on a separate listview would cause this.</p>
    singulars
    1. This table or related slice is empty.
    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.
    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