4

is there any possibility to sent over a consumable one-time event when navigating to another (unrelated and therefore not sharing the same viewmodel) screen in jetpack compose navigation? When handing over an argument via navigation, this value is not being consumed and therefore still present when navigating back and forth between different screens always re-triggering this event.

Do you know an elegant way to archive this? I want to avoid having something like a SharedFlow on Activity level and every Screen to collect it or to use SharedPrefs / DataStore to temporarely store those events. Thank you very much.

Sebastian
  • 90
  • 7
  • 1
    Can you please add the code in question? – Stelios Papamichail Mar 26 '22 at 17:51
  • Hi Stelios, just simple „navigate from Screen A to B“. My question is, how could one add a consumable event / parameter to a navigation action in Jetpack Compose Navigation. Normal navigation parameter added to the route will stay there / are not consumed. Thank you very much. – Sebastian Mar 26 '22 at 20:20

0 Answers0