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:

enter image description here

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

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Automatically create pages in phpfox -

c# - Farseer ContactListener is not working -