android - After replacing a fragment with other fragment, clicking on empty places in new fragment performing operations of previous fragment -
in android replacing first fragment second fragment upon button click using below code:
public class fragment1 extends fragment implements onclicklistener{ @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { .... @override public void onclick(view arg0) { fragment2 frag2 = new fragment2(); fragmentmanager fragmentmanager = getfragmentmanager(); fragmenttransaction fragmenttransaction = fragmentmanager .begintransaction(); fragmenttransaction.replace(r.id.frag1id,frag2); fragmenttransaction.commit(); }}}
with above code, on click page redirecting fragment2 fragment1 replacing fragment1.as second fragment layout contains controls there lot of empty space. when, mistake, click on empty space action performed related first fragment controls. how first fragment controls present in background. can please solution rid of issue.
i not know if , proper way of doing did this: set background of whole view in fragment
non-transparent color , did trick.
Comments
Post a Comment