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

Crashes app after going to background #14

Closed
ANPez opened this issue Aug 27, 2020 · 2 comments · Fixed by #16
Closed

Crashes app after going to background #14

ANPez opened this issue Aug 27, 2020 · 2 comments · Fixed by #16

Comments

@ANPez
Copy link

ANPez commented Aug 27, 2020

OnPause of my activity I do:

    if (nearDiscovery.isDiscovering) {
      nearDiscovery.stopDiscovery()
    }
    if (nearDiscovery.isDiscoverable) {
      nearDiscovery.makeNonDiscoverable()
    }
    if (nearConnect.isReceiving) {
      nearConnect.stopReceiving(false)
    }

but still it crashes with this error:

java.lang.IllegalArgumentException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull, parameter intent         at com.adroitandroid.near.connect.server.TcpServerService.onStartCommand(TcpServerService.kt)
@AndroFlo
Copy link

Hi, @ANPez the intent parameter of the onStartCommand in TcpServerService class is null but set as no nullable. You can make it non nullable because the documentation say

This may be null if the service is being restarted after its process has gone away, and it had previously returned anything except START_STICKY_COMPATIBILITY.

@ANPez
Copy link
Author

ANPez commented Aug 28, 2020

That's right, the TcpServerService is crashing when the system restarts the service. I think we should make it nullable to handle that case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants