I have a ViewPager with fragments. I want to add a new fragment in the first and added back button in the ActionBar. If you can offer me the idea to realization. Thanks!
Asked
Active
Viewed 47 times
0
-
What do you mean 'add a new fragment in the first'? In the viewPager? – Shayan_Aryan Nov 26 '15 at 18:09
-
Take a look at this answer: http://stackoverflow.com/questions/7723964/replace-fragment-inside-a-viewpager/13925130#13925130 – Daniel Nugent Nov 26 '15 at 18:17
-
And then the back button is: Activity.getActionBar().setHomeAsUpEnabled(true); Activity.getActionBar().setIcon(a back icon), and override Activity.onBackPressed. – Robin Davies Nov 26 '15 at 19:28
-
Thanks, guys! I solved my problem with link from @DanielNugent – Anton Lyapov Nov 27 '15 at 20:42