B4A Library ToastMessageShow v2.10

ToastMessageShow
Author:
Giuseppe Salvi
Version: 2.0
 

Attachments

  • ToastMessageShow v1.80.zip
    293 KB · Views: 1,499
  • Normal toast from  xml.png
    Normal toast from xml.png
    24.2 KB · Views: 2,414
  • Normal toast with nine-patch.png
    Normal toast with nine-patch.png
    27.4 KB · Views: 2,330
  • standard toast.png
    standard toast.png
    22.7 KB · Views: 2,151
  • Toast with button and bacckground image.png
    Toast with button and bacckground image.png
    117.4 KB · Views: 2,075
  • Toast with button background color and text shadow.png
    Toast with button background color and text shadow.png
    42.2 KB · Views: 2,071
  • Toast with buttton and resources nine-patch.png
    Toast with buttton and resources nine-patch.png
    81.7 KB · Views: 2,056
  • Toast with buttton and with background resources.png
    Toast with buttton and with background resources.png
    77.8 KB · Views: 2,128
  • Toast with buttton gradient and custom font.png
    Toast with buttton gradient and custom font.png
    190.4 KB · Views: 2,103
  • ToastMessageShowv2.10.zip
    50.2 KB · Views: 1,323
Last edited:

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)

upload_2017-11-25_21-6-11.png
 

SMOOTSARA

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?


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
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)
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....
 
Top