Closed LightKnight3r closed 1 year ago
Hi, @LightKnight3r can you share more logs? device android version and other info and if you have any more logs that would be great.
@mak12 thanks for reply. This error occurs when i use ACTIVITY_PROVIDER and listen location change in background. Whenever user's activity update, ActivityRecognitionLocationProvider will report changes. The function getProbableActivities() from ActivityRecognitionResult return null make app crash
@LightKnight3r got it, will look into it today.
hi @mak12, i make a pull request to handle this issue. Can you check and release it? https://github.com/mak12/background-geolocation-android/pull/2
yes sure will check this too, Have you tested this change? @LightKnight3r
yes, i think this error cause by changing new flag "FLAG_IMMUTABLE", sometimes ActivityRecognitionResult.extractResult has no result. I fixed by checking hasResult() condition. Maybe can use try - catch. https://stackoverflow.com/questions/70065929/getting-activityrecognitionresult-extractresultintent-as-null-while-trying-t
@LightKnight3r yes that's what I had in my mind, and will try to fix this.
ADB log: java.lang.RuntimeException: Error receiving broadcast Intent { act= com.marianhello.bgloc.DETECTED_ACTIVITY_UPDATE flg=0x10 } in com.marianhello.bgloc.provider.ActivityRecognitionLocationProvider$1@dfc5856 at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$getRunnable$0$LoadedApk$ReceiverDispatcher$Args(LoadedApk.java:1815) at android.app.LoadedApk$ReceiverDispatcher$Args$$ExternalSyntheticLambda0.run(Unknown Source:2) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:226) at android.os.Looper.loop(Looper.java:313) at android.os.HandlerThread.run(HandlerThread.java:67) Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.util.List com.google.android.gms.location.ActivityRecognitionResult.getProbableActivities()' on a null object reference at com.marianhello.bgloc.provider.ActivityRecognitionLocationProvider$1.onReceive(ActivityRecognitionLocationProvider.java:236) at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$getRunnable$0$LoadedApk$ReceiverDispatcher$Args(LoadedApk.java:1805) at android.app.LoadedApk$ReceiverDispatcher$Args$$ExternalSyntheticLambda0.run(Unknown Source:2) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:226) at android.os.Looper.loop(Looper.java:313) at android.os.HandlerThread.run(HandlerThread.java:67)
@mak12 i got this error make my app crash. it cause by "getProbableActivities()' on a null". can you fix it?