mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-09 07:16:04 -04:00
Fixed: ErrorActivity was not appearing in the non-debug version when the application crashed.
* We are using the `applicationContext` to start the `ErrorActivity`, which is outside the `Activity`. Therefore, to initiate the activity with an external context of the `Activity`, we must include the `FLAG_ACTIVITY_NEW_TASK` flag in the intent. Without this flag, the activity will not start.
This commit is contained in:
parent
fa3e2d1aab
commit
f7e14162fc
@ -18,6 +18,7 @@
|
||||
package org.kiwix.kiwixmobile.core.main
|
||||
|
||||
import android.content.Intent
|
||||
import android.content.Intent.FLAG_ACTIVITY_NEW_TASK
|
||||
import android.os.Bundle
|
||||
import android.os.Process
|
||||
import android.view.ActionMode
|
||||
@ -96,6 +97,7 @@ abstract class CoreMainActivity : BaseActivity(), WebViewProvider {
|
||||
val extras = Bundle()
|
||||
extras.putSerializable(ErrorActivity.EXCEPTION_KEY, paramThrowable)
|
||||
intent.putExtras(extras)
|
||||
intent.addFlags(FLAG_ACTIVITY_NEW_TASK)
|
||||
appContext.startActivity(intent)
|
||||
finish()
|
||||
Process.killProcess(Process.myPid())
|
||||
|
Loading…
x
Reference in New Issue
Block a user