Hallo,
hier die Fehlermeldung:
An dieser Stelle wird es Markiert: Service.StartForeground(1,Notification1)
Error occurred on line: 211 (Winsock)
java.lang.SecurityException: Permission Denial: startForeground from pid=8825, uid=10326 requires android.permission.FOREGROUND_SERVICE
at android.os.Parcel.createException(Parcel.java:1969)
at android.os.Parcel.readException(Parcel.java:1935)
at android.os.Parcel.readException(Parcel.java:1885)
at android.app.IActivityManager$Stub$Proxy.setServiceForeground(IActivityManager.java:5182)
at android.app.Service.startForeground(Service.java:695)
at anywheresoftware.b4a.objects.ServiceHelper.StartForeground(ServiceHelper.java:81)
at yamutec.app.winsock._astreams_newdata(winsock.java:739)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at anywheresoftware.b4a.BA$2.run(BA.java:370)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:280)
at android.app.ActivityThread.main(ActivityThread.java:6706)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: android.os.RemoteException: Remote stack trace:
at com.android.server.am.ActivityManagerService.enforcePermission(ActivityManagerService.java:9596)
at com.android.server.am.ActiveServices.setServiceForegroundInnerLocked(ActiveServices.java:1204)
at com.android.server.am.ActiveServices.setServiceForegroundLocked(ActiveServices.java:885)
at com.android.server.am.ActivityManagerService.setServiceForeground(ActivityManagerService.java:21087)
at android.app.IActivityManager$Stub.onTransact$setServiceForeground$(IActivityManager.java:10433)
private Sub UpdateNotification
Dim content As String
If connected Then
content = "Connected"
Else
content = "Disconnected"
End If
Notification1.Initialize2(Notification1.IMPORTANCE_LOW)
Notification1.Icon = "icon"
Notification1.SetInfo("Meldung", content, Input_Output)
Notification1.Notify(1)
End Sub