1

Scroll Issue in Multilevel ExpandableListview in android

I have browsed for implementing multilevel ExpandableListView and i came to know with very important

blogs : Link1 Link2

Stackoverflow Link: Link1

Implemented multilevel ExpandableListview with Blog but faced problem that all child not visible and can't scroll at 3rd level. So i searched for scrolling issues and found here that which blog i am following gave static height and width of ExpandableListview in onMessured.

protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) 
  {
   widthMeasureSpec = MeasureSpec.makeMeasureSpec(960, MeasureSpec.AT_MOST);
   heightMeasureSpec = MeasureSpec.makeMeasureSpec(600, MeasureSpec.AT_MOST);
   super.onMeasure(widthMeasureSpec, heightMeasureSpec);
  }  

replaced with

@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec){
    widthMeasureSpec = MeasureSpec.makeMeasureSpec(MeasureSpec.getSize(widthMeasureSpec), MeasureSpec.EXACTLY);
    heightMeasureSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE, MeasureSpec.AT_MOST);
    super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}

So my scrolling issue gone but because of maximum height .

heightMeasureSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE, MeasureSpec.AT_MOST);

given to elv getChildView of 2nd Elv called only once and all child loading at first time. This will causing memory issue for large set of data and i can't applied pull to refresh.

how to resolve this issue and any batter idea to implement multilevel ELV?

Community
  • 1
  • 1
Nil
  • 312
  • 4
  • 19

0 Answers0