Skip to content

Fix navigation logic for physical phone's back button#3358

Open
amirmahdifard wants to merge 1 commit into
BearWare:masterfrom
amirmahdifard:backNavigation
Open

Fix navigation logic for physical phone's back button#3358
amirmahdifard wants to merge 1 commit into
BearWare:masterfrom
amirmahdifard:backNavigation

Conversation

@amirmahdifard

Copy link
Copy Markdown
Contributor

Previously, users could only navigate TeamTalk safely using the "Navigate Up" button. The phone's physical back button was not supported, causing users to be disconnected immediately and lose their session. This change handles the phone's back button to act the same as the navigation button. Refactored the code into a clean helper method for both to use, with clear comments indicating each step of the logic.

@amirmahdifard

Copy link
Copy Markdown
Contributor Author

@bear101 Finally, I did my best to wright clean and explaning commit messages, clean comments, with no spelling mistakes😊
do you like this way?

@bear101

bear101 commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

I only have the emulator to test Android. When i press Back button then it still returns immediately to the server list.

@amirmahdifard

Copy link
Copy Markdown
Contributor Author

@bear101 what's your android version? may be I need to use the onBackPressed dispachor anyway instead of the discontinued onBackPressed method.

@amirmahdifard

Copy link
Copy Markdown
Contributor Author

I will push a new commit, please tell me if that fixes it or not.

@amirmahdifard

Copy link
Copy Markdown
Contributor Author

@bear101 would you please try it one more time?
I have updated the navigation logic to use OnBackPressedDispatcher. This should fix the issue on modern emulators (Android 13+) where the legacy onBackPressed() method is often bypassed.
I was awhere of this, but I didn't use this new callback because I didn't think we will need it. But this is the new way introduced by google to replace the old one for apps who wants to controle the back button.
Please let me know if it works for you now. Thanks!

@amirmahdifard

Copy link
Copy Markdown
Contributor Author

@bear101 please when you tested this again, also tell me is the shrinking exit animation for android works fine with this? because I also want to handle android's shrinking exit animation

@amirmahdifard

Copy link
Copy Markdown
Contributor Author

@bear101 bro, remember in 2024 you promiced me that you will give me a teamtalk sdk lisence soon?
will you give it to me now please? thanks!

@Nardol

Nardol commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Well, now we all know exactly why you’re so eager to get your contributions merged into the project 🤣

@amirmahdifard

Copy link
Copy Markdown
Contributor Author

@Nardol no today my friend asked me to run a pro server, and it's not possible to run it without lisence. One of my friends gave me a tt sdk lisence But i don't like to use it. And it's not linked to my account anyway. Also, it's not so much important, I just remembered and asked.
For my contributions value, mentioning my name in updates news leter makes me more happy than getting a lisence.

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

Successfully merging this pull request may close these issues.

3 participants