Hi guys, I'm new to Kotlin (and coding in general) and I need help and guidance with some codes, I h...
f
Hi guys, I'm new to Kotlin (and coding in general) and I need help and guidance with some codes, I have created four activities on Android studio, and I am trying to use "Intent" to navigate from one activity to the other....My code worked well when moving from MainActivity to the second activity (Genderpg, but when I tried moving from the 2nd Activity to the third (AgePg02), the Emulator keeps returning me back to the Main activity.....here are images of my code...
stackoverflow 4
😢 7
l
seems good to me. Are you sure of
btn_gender_back
and
btn_gender_continue
are not inverted in your xml ? Also, from what I can see, I suggest you to move to ViewPager with fragment. It’s a bit more complicated, but in the end, I will be easier to handle this kind of navigation flow
r
Just wanted to draw attention to the existence of the
finish()
call on an activity. This will simply take the activity off of the backstack as opposed to adding a new one. If you keep making new activities you will end up with quite a lot after navigating a bit, and your app will consume less memory if you simply pop them with the call to
finish()
Other than that looks good to me as well!
f
Thanks @Louis Gautier and @Ronald Wolvers I will long into using the ViewPager with fragment and the finish() call in my code πŸ‘πŸ½
πŸ˜ƒ 1
πŸ™‡β€β™‚οΈ 1
r
Good luck with the app @Fisayo!!