mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Fixed going back to default fragment when rotating the device
This commit is contained in:
parent
91ec675cbe
commit
6faff7f780
2 changed files with 12 additions and 0 deletions
|
|
@ -386,6 +386,16 @@ class MainActivity : GenericActivity() {
|
|||
|
||||
@MainThread
|
||||
private fun handleMainIntent(intent: Intent, isNewIntent: Boolean) {
|
||||
// Prevent navigating to default fragment upon rotation (we only want to do it on first start)
|
||||
if (intent.action == Intent.ACTION_MAIN && intent.type == null && intent.data == null && !isNewIntent) {
|
||||
if (viewModel.mainIntentHandled) {
|
||||
Log.d("$TAG Main intent without type nor data was already handled, do nothing")
|
||||
return
|
||||
} else {
|
||||
viewModel.mainIntentHandled = true
|
||||
}
|
||||
}
|
||||
|
||||
if (intent.hasExtra("Chat")) {
|
||||
Log.i("$TAG Intent has [Chat] extra")
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -86,6 +86,8 @@ class MainViewModel @UiThread constructor() : ViewModel() {
|
|||
|
||||
var accountsFound = -1
|
||||
|
||||
var mainIntentHandled = false
|
||||
|
||||
private var defaultAccountRegistrationFailed = false
|
||||
|
||||
private val alertsList = arrayListOf<Pair<Int, String>>()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue