Last active
May 11, 2019 19:31
-
-
Save PHELAT/da6a3576ce1308291104d054443680bd to your computer and use it in GitHub Desktop.
navigateUp with Bundle!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is an extension function on Fragment | |
import com.phelat.navigationresult.navigateUp | |
class FragmentB : Fragment() { | |
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | |
super.onViewCreated(view, savedInstanceState) | |
anotherButton.setOnClickListener { | |
val bundle = Bundle().apply { | |
putBoolean(IS_LOG_IN_SUCCESSFUL, true) | |
} | |
navigateUp(FragmentA.REQUEST_CODE, bundle) | |
} | |
} | |
companion object { | |
const val IS_LOG_IN_SUCCESSFUL = "is_log_in_successful" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment