Notifier.ShowAlert not working

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)

Where did you see that?
Handler runs runnable on main thread.

I saw it in the original source code

i dont get it, do you mean this line = handler.post(new Runnable() {

Yes that one.

2 Likes

@vknow360 hmm, that seems amazing i'll learn about it