android - getting error in Expandable Listview on open fragment in onGroupClickListener -


in expandable listview ongroupclicklistener maine ye fragment khulne chahiye or maine onchildclicklistener pe bhi kuch fragments dale hue onchild wale chl rhe h ongroup wale pe click kerne pe unfortunately stop ho ja rhi h

explistview.setongroupclicklistener(new expandablelistview.ongroupclicklistener() {          @override         public boolean ongroupclick(expandablelistview parent, view v,                                     int groupposition, long id) {             fragment fragment=null;              if (groupposition==0){                 intent intent=new intent(mainactivity.this,mainactivity.class);                 startactivity(intent);             } else if (groupposition==3){                 fragment=new appointments();             } else if (groupposition==4) {                 fragment=new medicine();             }else if (groupposition==5){                 fragment=new stationary();             }else if (groupposition==7){                 fragment=new courier();             }              fragmentmanager fragmentmanager = getfragmentmanager();             fragmenttransaction ft=fragmentmanager.begintransaction();             ft.replace(r.id.frame,fragment,"hello");             ft.commit();             drawer.closedrawer(gravitycompat.start);             return false;         }     }); 


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -