B4J Question B4J cutils.ShowNotification on TOP of other Apps...

Magma

Expert
Licensed User
Longtime User
Hi there...

is it possible to use cutils.ShowNotification on top of other apps... someway or a different library of notification ?

for those celebrating... Merry Christmas - many happy returns :)

Thanks in advance

ps: nice forum upgrade!
 
sorry didn't understand...

when i call it - call it like this:

B4X: Copy
Private cutils As ControlsUtils

cutils.ShowNotification("mytitle", "blablah...",  cutils.ICON_INFORMATION)

You mean... the form... ??
B4X: Copy
MainForm.SetOwner(Null)

this gives me error:
main._appstart (java line: 75)
java.lang.NullPointerException
at anywheresoftware.b4j.objects.Form.SetOwner(Form.java:222)
at b4j.example.main._appstart(main.java:75)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:91)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:78)
at b4j.example.main.start(main.java:37)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$162(LauncherImpl.java:863)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$175(PlatformImpl.java:326)
at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191)
at java.lang.Thread.run(Thread.java:748)


It should show outside of your form is you set the Owner to Null (or call ShowNotification which implicitly sets it to null).

Is it covered by other windows when you call it?

...Yes... actually when i am going to other application - i want it when i have a notification to come on top (only the notification - not the app)
 
Upvote 0
You mean... the form... ??
No.

Yes... actually when i am going to other application - i want it when i have a notification to come on top (only the notification - not the app)
It is not configurable. You will need to create a custom notification made of a form.
 
Upvote 0

found solution :-)

B4X: Copy
Sub setAlwaysOnTop(frm As Object, Value As Boolean)
    Dim frmJO As JavaObject = frm
    Dim stage As JavaObject = frmJO.GetField("stage")
    stage.RunMethod("setAlwaysOnTop", Array(Value))
End Sub

Thanks...
 
Upvote 0
Back
Top