im facing problem in fragments during animation... im new fragment concept im unable it.. problem is....
1. placed fragment on activity.
2. when press on button set animation show fragment
3. , added addbackstack.
4. after in second fragment kept button in if press button fragment closed used popbackstack.
5. until clear.
6. problem when click on button should close animation used code
ft.setcustomanimations(r.anim.slide_in_up,r.anim.slide_out_down, r.anim.slide_in_up,r.anim.slide_out_down);
7.but not showing animation , closes.
8.i check api version compatibility unable find mistake
hope have give sufficient information question , guys have understood problem.if seems insufficient please let me know that. thank you
here im repalcing fragment! fragment2 animation:
icon.setonclicklistener(new onclicklistener() { @override public void onclick(view v) { fragmenttransaction ft = getfragmentmanager() .begintransaction(); android.app.fragmentmanager m=getactivity().getfragmentmanager(); ft.setcustomanimations(r.anim.slide_in_up, r.anim.slide_out_down); fragment2 n2 = new fragment2(); ft.replace(r.id.realtabcontent, n2); ft.addtobackstack(null); ft.commit(); });
here im closing fragment2 animation:
b.setonclicklistener(new onclicklistener() { @override public void onclick(view v) { android.app.fragmentmanager m=getactivity().getfragmentmanager(); fragmenttransaction ft = getactivity().getfragmentmanager() .begintransaction(); m.popbackstack(); ft.setcustomanimations(r.anim.slide_in_up,r.anim.slide_out_down, r.anim.slide_in_up,r.anim.slide_out_down); ft.commit(); } });
but here animation not working me...
have enabled animations in device settings?
Comments
Post a Comment