2013-08-12 52 views
0

我想在我的android應用程序中使用expandablelistview,問題是,當我單擊一個擴展組時,整個expandablelistview消失,沒有人有同樣的問題,並知道如何解決它?expandablelistview消失時組崩潰

我getChildrenCount & getGroupCount methoods:

 @Override 
    public int getChildrenCount(int groupPosition) { 
     // TODO Auto-generated method stub 
     return 1; 
    } 

    @Override 
    public int getGroupCount() { 

     return super.getGroupCount(); 
    } 
+0

你實現該方法'getGroupCount'和' getChildrenCount'?聽起來像計數變爲0,所以你的整個列表包含NO項 - >它消失。 – user2652394

+0

我發佈了代碼 – Develop2Android

回答

0

我通過重寫onCollpse使它()在它methood & notifyDataSetInvalidated():

@Override 
    public void onGroupCollapsed(int groupPosition) { 

     notifyDataSetInvalidated(); 

    } 
相關問題