STAR-ZERO / navigation-keep-fragment-sample

392 stars 63 forks source link

back in action bar #20

Open FaithLaou opened 4 years ago

FaithLaou commented 4 years ago

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??

STAR-ZERO commented 4 years ago

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

mustofa-id commented 4 years ago

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.

FaithLaou commented 4 years ago

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 :(

STAR-ZERO commented 4 years ago

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

FaithLaou commented 4 years ago

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!