deltachat / deltachat-android

Email-based instant messaging for Android.
GNU General Public License v3.0
1.07k stars 145 forks source link

"back" button behaviour after creating/adding profiles #3119

Closed r10s closed 3 weeks ago

r10s commented 1 month ago

when a profile was added, one ends up in the chatlist, which is fine.

however, when then hitting the "back" button, the app should just exit (as it does otherwise as well)

this is esp. bad for the very first profile created, on very first app start ppl land again in "add profile" unexpectedly.

not a blocker or so, but should still be fixed soon

tested on android7 - might be different in other android versions, this stacking of activities is tricky sometimes when supporting a broad range of android versions :)

adbenitez commented 1 month ago

mmh... what happens is that we don't finish WelcomeActivity when going to InstantOnboarding activity because user can go back, when account creation finishes we launch chatlist activity and finish the current activity (InstantOnboarding activity) but at that point I don't know if we can also finish the previous activity from within InstantOnboarding activity

adbenitez commented 1 month ago

a solution would be to always exit the app onBackPressed in the ConversationListActivity/chatlist but might have side effects ex. we might need to take care of keyboard hidding in the search bar via back pressed

r10s commented 1 month ago

but at that point I don't know if we can also finish the previous activity from within InstantOnboarding activity

why can't we know to finish WelcomeActivity?

i was indeed thinking about removing WelcomeActivity and /InstantOnboarding from the stack when ChatlistActivity is started from there; and only in that case

adbenitez commented 1 month ago

why can't we know to finish WelcomeActivity?

you know you have to finish, what I don't know is how to finish it from withing InstantOnboardingActivity before switching to ConversationListActivity, I have no experience with activity stacking/navigation and that proved to be a mess already in the past

adbenitez commented 1 month ago

maybe this can be solved using Intent.FLAG_ACTIVITY_CLEAR_TASK when launching the ConversationListActivity from the InstantOnboardingActivity