Notifier.ShowAlert not working

Try it
notifiertoast.aia (1.5 KB)

2 Likes

ShowAlert works with Button my place too, but not with ListPicker

1 Like

works for me with listpicker on Android 11

image

2 Likes

@TIMAI2

I tried even simpler example, and it does not show up the alert.
image
Could you verify at your place?

alertTest.aia (7.4 KB)

Yes, it works for me, on Android 11 companion mode.

But you do need to add at least one element to select from your listpicker, in order to fire the afterPicking event!

1 Like

Deprecated does not mean, that it does not work anymore...

What does not work anymore is the ShowAlert method together with using the close application event, see here

Taifun

2 Likes

The question is, does it still work after building the app?

Taifun

Yes it does

but i have tried on my android 11 device it doesn't work at all :disappointed:

you forgot to tell us, what exactly you are testing...
EDIT: which device are you using for your tests?
try the example project

together with

Taifun
PS: I removed the checkmark for the "solution"

1 Like

has the target API of that aia been changed?
because if the target API is changed to 29 it can indeed work on android 11

Samsung Galaxy A52 "Real Device not emulator"

Sorry if this is a lame question, but how you change the target API?

I can confirm that ShowAlert works in AfterPicking event if the list is not empty.

But, ShowAlert does not work in BeforePicking event

image

1 Like

I find that too, it is probably a timing issue. You can work around this with a clock (tested at 100ms)

image

2 Likes

you can do that by using APK Editor Studio (Only For APK file)

1 Like

Target SDK doesn't do anything here. If an API is deprecated it will still be deprecated even if you target a lower SDK.

2 Likes

:face_with_monocle: Okay, now I understand,
but do you know what causes CustomToast to work on Android level 11?

It is probably in here:

the system blocks toasts that contain custom views if those toasts are sent from the background by an app that targets Android 11 or higher

Is the AI2 notifier not sending the toast from the background?

1 Like

:thinking: According to the code I saw AI2 notifier sending toast from the background,
because if notifier is not sending toast from background then AI2 doesn't need to use Class Toast
(use canvas to show toast)