Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getrootfragment function access modifier #52

Open
maqtay opened this issue Jan 17, 2024 · 1 comment
Open

getrootfragment function access modifier #52

maqtay opened this issue Jan 17, 2024 · 1 comment

Comments

@maqtay
Copy link

maqtay commented Jan 17, 2024

There are 5 tabs in the app. When the user clicks the back button on some of these tabs, I want to raise an alert without looking at the stack and close the application when the user clicks on this alert. How can I do this? An idea came to my mind, but since the getrootfragment function is private, I cannot access this function and control the tab. Would it be a problem to make this private function public?

@bilgehankalkan
Copy link
Contributor

You can use NavigatorListener interface. This interface will invoke onTabChanged with tab index.

Both MainActivity and MainActivity2 on :app provides sample implementations for this interface.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants