B4A Library ToastMessageShow v2.10

Ohanian

Active Member
Licensed User
Longtime User
Hi,

Got this error on some Android 6 devices :

B4X:
android.view.WindowManager$BadTokenException: Unable to add window android.view.ViewRootImpl$W@40ec8528 -- permission denied for this window type

here's some info about the error :

B4X:
http://stackoverflow.com/questions/32224452/android-unable-to-add-window-permission-denied-for-this-window-type

and

B4X:
http://stackoverflow.com/questions/7569937/unable-to-add-window-android-view-viewrootw44da9bc0-permission-denied-for-t

any solution?
 

Mikonios

Active Member
Licensed User
Longtime User
I am afraid that there is some problem in the timer and it does not allow to launch in parallel several ::
toast.Show4 (MiTit, MiMess, toast.SUCCESS_ICON)

 

SMOOTSARA

Active Member
Licensed User
Longtime User


Hi,
I have the same problem

B4X:
android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running?
    at android.view.ViewRootImpl.setView(ViewRootImpl.java:679)
    at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:342)
    at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:94)
    at it.giuseppe.salvi.notification.core.ToastShow$ToastManager.display(ToastShow.java:1519)
    at it.giuseppe.salvi.notification.core.ToastShow$ToastManager.handleMessage(ToastShow.java:1498)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:159)
    at android.app.ActivityThread.main(ActivityThread.java:6139)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
 

wes58

Active Member
Licensed User
Longtime User
What is your targetSDKVersion in the Manifest?
If it is >= 23 you will get this error - search the web and you will find information why.
So the only way to get it working, is to set in the manifest targetSdkVersion to < 23. I have in my app set to 20 (done a couple of years ago and never bothered to change it) and it is still works on Android 7.
 

pjo12345

Active Member
Licensed User
Longtime User
That's exactly where I am now. And what next? Is there a solution? Currently I have disabled ToastMessage.
 

EduardoElias

Well-Known Member
Licensed User
Longtime User
I am using an Android 8.1 and b4a 8.3 and ToastMessageShow 2.1

The last message shown are kept on the screen forever

I am still using
<uses-sdk android:minSdkVersion="14"
android:targetSdkVersion="14"/>

I am aware I have to change this soon.

Is this problem related to running on Android 8? or else?

Most of my other androids are < 8 and works just fine.
 
ToastMessageShow
Author:
Giuseppe Salvi
Version: 2.0

Help....

Sub Globals
Dim toast As ToastMessageShow ' --> OK
End Sub

Sub InitializeToast()
toast.Initialize("toast") ' --> OK
toast.TitleLocation = toast.Gravity.TCenter ' ERROR --> : Unknown member : TitleLocation

End Sub

Please help....
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…