Android Question [RESOLVED] SDK 34, Phone Events

Jmu5667

Well-Known Member
Licensed User
Longtime User
Sorry.

I have a class that uses phone events. In the class initialize I initialize the phone events and get the following error:

B4X:
Public Sub Initialize

    NativeMe.InitializeStatic(Application.PackageName & ".cls_tpa_sender")
    mod_functions.writelog($"cls_tpa_sender(), Initialize"$)
    tmrWifiAlert.Initialize("tmrWifiAlert",500)
    PE.Initialize("PE") <- GENERATES ERROR

End Sub

Error:
B4X:
07/17/2024 16:16:01.953 - Atlas SOS - cls_tpa_sender(), Initialize
cls_tpa_sender_initialize (java line: 180)
java.lang.SecurityException: com.is.vitllinkSOS: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts
    at android.os.Parcel.createExceptionOrNull(Parcel.java:3087)
    at android.os.Parcel.createException(Parcel.java:3071)
    at android.os.Parcel.readException(Parcel.java:3054)
    at android.os.Parcel.readException(Parcel.java:2996)
    at android.app.IActivityManager$Stub$Proxy.registerReceiverWithFeature(IActivityManager.java:5684)
    at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1868)
    at android.app.ContextImpl.registerReceiver(ContextImpl.java:1804)
    at android.app.ContextImpl.registerReceiver(ContextImpl.java:1792)
    at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:765)
    at anywheresoftware.b4a.phone.PhoneEvents.Initialize(PhoneEvents.java:303)
    at com.is.vitllinkSOS.cls_tpa_sender._initialize(cls_tpa_sender.java:180)
    at com.is.vitllinkSOS.svc_service._service_create(svc_service.java:5229)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:221)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:201)
    at com.is.vitllinkSOS.svc_service$2.run(svc_service.java:88)
    at android.os.Handler.handleCallback(Handler.java:958)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loopOnce(Looper.java:257)
    at android.os.Looper.loop(Looper.java:368)
    at android.app.ActivityThread.main(ActivityThread.java:8826)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:572)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1049)
Caused by: android.os.RemoteException: Remote stack trace:
    at com.android.server.am.ActivityManagerService.registerReceiverWithFeature(ActivityManagerService.java:14900)
    at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:2570)
    at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:3005)
    at android.os.Binder.execTransactInternal(Binder.java:1392)
    at android.os.Binder.execTransact(Binder.java:1299)

Regards

John
 
Upvote 0
Top