navigation-keep-fragment-sample icon indicating copy to clipboard operation
navigation-keep-fragment-sample copied to clipboard

back in action bar

Open FaithLaou opened this issue 5 years ago • 5 comments

Hi! I really liked this project! One question, how will you include navigation, I mean the back button in the the action bar of only one of the tabs of the bottom navigation bar??

FaithLaou avatar Jan 16 '20 01:01 FaithLaou

What exactly does that mean? If you want you can use Toolbar anywhere.

STAR-ZERO avatar Jan 16 '20 04:01 STAR-ZERO

If you using default action bar, just call setupActionBarWithNavController. To prevent up button in actionbar shown in top-level destination use AppBarConfiguration(setOf(/* ids */)). For more info check NavigationUI docs.

mustofa-id avatar Jan 16 '20 06:01 mustofa-id

I tried to do it with the setupActionBarWithNavController in the main activity but it is not working because we have a container for Home that has it's own navigation.... How will you add the action bar navigation for the different tabs...I'm lost... can someone tell me please what I should add or change in the code? I will really appreciate that! It has been driving me crazy :(

FaithLaou avatar Jan 16 '20 17:01 FaithLaou

Using Toolbar instead of ActionBar might solve your problem. When I have enough time I'll try it.

STAR-ZERO avatar Jan 17 '20 05:01 STAR-ZERO

Cool! Thanks man!! Quick question, I have an activity B that is being called from one of the fragments (lets call it fragment f) that are included in the fragment container that is in the host activity A. there is a button in the activity B that needs to take me back to the fragment f that called that activity but at the same time I need the fragment f to be updated... the problem is, I can't seem to update that fragment... it just brings me back the last state of that fragment... what can I do to call back and update the calling fragment (f) when I press that button in activity B? Oh my gosh, I'm still learning and this is really driving me crazy for days now. I would appreciate any help and guidance!

FaithLaou avatar Jan 20 '20 17:01 FaithLaou