Android Question Bubble crashes

Shivito1

Active Member
Licensed User
I'm not sure ware it is crashing but it tells me that a service is responsible. Also looks like it could be permission related. However I have handled the only *Permission which was the Write/Read permission.

The crash happens when I click a checkbox that enables the floating window and makes the app transparent.

Error
B4X:
(NumberFormatException) java.lang.NumberFormatException: For input string: "1"
(NumberFormatException) java.lang.NumberFormatException: For input string: "1"
** Service (subreader_service) Start **
(NumberFormatException) java.lang.NumberFormatException: For input string: "1"
TTS1.SpeechRate 1
Subtitles by explosiveskull
** Service (standout) Create **
** Service (standout) Start **
java.lang.RuntimeException: Unable to start service b4a.example.standout@acf3b0f with Intent { cmp=com.subreader/b4a.example.standout }: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
    at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3710)
    at android.app.ActivityThread.-wrap22(Unknown Source:0)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1827)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loop(Looper.java:164)
    at android.app.ActivityThread.main(ActivityThread.java:7002)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:441)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1408)
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:216)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:163)
    at b4a.example.standout.handleStart(standout.java:113)
    at b4a.example.standout.onStartCommand(standout.java:81)
    at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3693)
    ... 8 more
Caused by: java.lang.reflect.InvocationTargetException
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4j.object.JavaObject.RunMethod(JavaObject.java:131)
    at b4a.example.standout._init_elements(standout.java:314)
    at b4a.example.standout._service_start(standout.java:552)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:179)
    ... 12 more
Caused by: android.view.WindowManager$BadTokenException: Unable to add window android.view.ViewRootImpl$W@b47b86e -- permission denied for window type 2002
    at android.view.ViewRootImpl.setView(ViewRootImpl.java:1006)
    at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:384)
    at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:101)
    at b4a.example.standout$CustomImageView.sharedConstructing(standout.java:633)
    at b4a.example.standout$CustomImageView.<init>(standout.java:604)
    at b4a.example.standout.newInstance2(standout.java:771)
    ... 18 more
@Star-Dust
 
Last edited:

Computersmith64

Well-Known Member
Licensed User
Longtime User
You're not giving us much to go on! Can you post the code that's executed when the checkbox? I think the first 2 lines of your log are a big hint...

- Colin.
 
Upvote 0

Shivito1

Active Member
Licensed User
You're not giving us much to go on! Can you post the code that's executed when the checkbox? I think the first 2 lines of your log are a big hint...

- Colin.
B4X:
Sub btnfloat_CheckedChange(Checked As Boolean)
    If List0.IsInitialized And List0.Size >= 1 Then
        If Checked == True Then
            FloatingStandOut.Start(Me)
            'p.SetScreenOrientation(-1)
        Else
            FloatingStandOut.Stop
            Activity.Finish
            'p.SetScreenOrientation(1)
        End If
    Else
        btnfloat.Checked = False
        ToastMessageShow("Subtitle must be selected first",True)
    End If
End Sub
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Upvote 0
Top