Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getApplicationContext suddenly not returning Kontalk instance any more #1182

Closed
daniele-athome opened this issue Jun 18, 2018 · 1 comment
Closed
Assignees
Labels
bug Something isn't working
Milestone

Comments

@daniele-athome
Copy link
Member

On a few devices on Android 8.0, context.getApplicationContext() from a BroadcastReceiver isn't returning a Kontalk object any more. And of course no documentation about that. Probably something related to the context being created with a different/wrapped/whatever application context.
Replace the Kontalk-casted getApplicationContext calls with a simple singleton.

Caused by: java.lang.ClassCastException: 
  at org.kontalk.service.NetworkStateReceiver.shouldReconnect (NetworkStateReceiver.java:125)
  at org.kontalk.service.NetworkStateReceiver.onReceive (NetworkStateReceiver.java:80)
  at android.app.ActivityThread.handleReceiver (ActivityThread.java:3266)
@daniele-athome daniele-athome added the bug Something isn't working label Jun 18, 2018
@daniele-athome daniele-athome self-assigned this Jun 18, 2018
@daniele-athome daniele-athome added this to the Next milestone Jun 19, 2018
@daniele-athome
Copy link
Member Author

Actually linked to #1186

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant