mirror of https://github.com/tuskyapp/Tusky.git
Browse Source
`UnifiedPush.registerAppWithDialog` will show a dialog when there are 2
or more distributors, for that it needs an activity context but we
passed an application one. I think this is improved in a newer Unified
push library version, will upgrade soon. In the meantime this change
fixes the crash.
```
android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running?
at android.view.ViewRootImpl.setView(ViewRootImpl.java:1314)
at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:421)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:149)
at android.app.Dialog.show(Dialog.java:352)
at org.unifiedpush.android.connector.UnifiedPush.registerAppWithDialog(UnifiedPush.kt:139)
at org.unifiedpush.android.connector.UnifiedPush.registerAppWithDialog$default(UnifiedPush.kt:67)
at com.keylesspalace.tusky.components.systemnotifications.NotificationService.setupPushNotificationsForAccount(NotificationService.kt:775)
at com.keylesspalace.tusky.components.systemnotifications.NotificationService.access$setupPushNotificationsForAccount(NotificationService.kt:76)
at com.keylesspalace.tusky.components.systemnotifications.NotificationService$setupPushNotificationsForAccount$1.invokeSuspend(Unknown Source:15)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7932)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:942)
```
pull/5030/head
3 changed files with 15 additions and 24 deletions
Loading…
Reference in new issue