Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Multilevel expandable list - Filter Issue

See original GitHub issue

I implemented the multilevel expandable list as follows.

Item 1  ->  sticky header (extends AbstractFlexibleItem implements IExpandable, IHeader)
   Item 1.1  -> sub header(extends AbstractFlexibleItem implements IExpandable)
     Item 1.1.1 -> sub item(extends AbstractFlexibleItem implements ISectionable, IFilterable)
     Item 1.1.2
Item 2
   Item 2.1
     Item 2.1.1
     Item 2.1.1

The above showed implementation works fine, but sometimes i got exceptions like follows while filtering the data.

 if (mAdapter.hasNewSearchText(newText)) {
            Log.d(TAG, "onQueryTextChange newText: " + newText);
            // Fill and Filter mItems with your custom list and automatically animate the changes
            // Watch out! The original list must be a copy
            mAdapter.filterItems(new ArrayList<>(items), 100);

 Process:, PID: 7749
 java.lang.IndexOutOfBoundsException: Inconsistency detected. Invalid item position 4(offset:-1).state:7
	 at android.view.Choreographer$
	 at android.view.Choreographer.doCallbacks(
	 at android.view.Choreographer.doFrame(
	 at android.view.Choreographer$
	 at android.os.Handler.handleCallback(
	 at android.os.Handler.dispatchMessage(
	 at android.os.Looper.loop(
	 at java.lang.reflect.Method.invoke(Native Method)

I am unable to handle this exception. Please correct me if i implemented the expandable list in wrong way (I followed the sample application to implement this feature).

Flexible adapter version: eu.davidea:flexible-adapter:5.0.0-rc1

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

davideascommented, May 3, 2017

@antoantonyk, the filter for multilevel should work and is available in the snapshot version.

The Snapshot version (future rc2) is more advanced in terms of new features and fixed bugs from rc1, as you can see from issue 39. So it is more stable than rc1, but it can change often based on my ongoing development and of course can introduce new bugs!! Since it doesn’t require any action from your side, you will receive the update once the new one is published and your cache updated after 1 day normally.

I think you can say to Gradle to not update a specific library or you can add it as external lib to close the production build.

davideascommented, May 1, 2017

@antoantonyk, I think you should use the Snapshot version since I could have resolved that bug recently see #328. Also be sure to correctly implement equals() and hashCode() for each items.

Unfortunately, there’s missing filtering for the sub-sub items. So your subItem won’t be filtered in this version as well. I will add it soon.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issue with Expanding Multi-Level ExpandableListView
I have a multi level (3 levels, Root -> Parent -> Child) ExpandableListView containing children that are also ExpandableListViews. I'm having no issue...
Read more >
Android ExpandableListView Example Tutorial - DigitalOcean
Android ExpandableListView is a view that shows items in a vertically scrolling two-level list. It differs from a ListView by allowing two ...
Read more >
Multilevel Expandablelistview In Android - ADocLib
The items come from the ExpandableListAdapter associated with this view.Expandable lists are able to show an indicator beside each item to display the...
Read more >
Multilevel Menu Design Best Practices - Toptal
Apply these guidelines to design intuitive multilevel menus that increase findability and offer a consistent experience across devices.
Read more >
Bootstrap nested (multilevel) Dropdown - free examples
Nested dropdowns built with Bootstrap 5. Tutorial & templates for multilevel navbar dropdowns menu, activated on hover or on click & much more....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found