Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialRifqi Fahmi
23,164 PointsThe addToBackStack() now support on Fragment (android.app) !
When i follow this video I try not to change the package and still use the Fragment from android.app and it work fine. I use android studio 2.1.2
Is the problem already fixed by android Ben Deitch ? If yes just reminder here hehe
Simon Coates
28,694 Pointsandroid extended AppCompatActivity by default for me, so I swapped in Activity and made some trivial code changes to confirm to myself that code I was viewing was fresh. Back button seemed to work in either case. So unless there's further information, the gotcha doesn't seem to apply.
3 Answers
Rohan Tilekar
134 PointsYes, adding fragmentTransaction.addToBackStack(null) worked for me perfectly. there should be a update in this video.
aldoolivares
14,478 PointsRifqi Fahmi oh ok thanks
aldoolivares
14,478 PointsI am using Android Studio 2.2 RC 2 and addBackStack() works just fine.
aldoolivares
14,478 PointsBen Deitch Ben Jakuben addToBackStack seems to be working fine now. Shouldnt there be a teacher's notes about this?
Rifqi Fahmi
23,164 PointsI think u should follow the instruction to use the android.support in order to follow the video because u will find some method in the video are not exist if you use the android.app
Daniel Bowen
8,577 PointsDaniel Bowen
8,577 PointsThis is true for me as well. I believe there definitely should be a teacher's notes change for this course.