android - Previous fragment visible under the new fragment -
i have tab + viewpager layout , in 1 of these tabs have list view. when replace list fragment upon onclick can still see old fragment under new fragment. see:

code:
fragmentmanager fragmentmanager = getfragmentmanager(); fragmenttransaction transaction = fragmentmanager.begintransaction(); hallsinstatefragment hallsforstate = new hallsinstatefragment(); transaction.replace(r.id.container, hallsforstate); transaction.addtobackstack(null); transaction.commit(); where r.id.container framelayout in view.
instead of r.id.container put id of fragment this: ((viewgroup)getview().getparent()).getid(). not replacing fragment previous layout i.e framelayout. works me , hope work in case also.
Comments
Post a Comment