B4A Library SD: Floating Button StandOut

Marcos Alves

Well-Known Member
Licensed User
Longtime User


Hello ! I'm getting the error:

java.lang.RuntimeException: Unable to create service b4a.example.standout: java.lang.RuntimeException: java.lang.RuntimeException: Cannot change properties after call to SetInfo. Initialize the notification again.

any suggestion?
 

Star-Dust

Expert
Licensed User
Longtime User
A notification is created to keep the service always active.
Com Android 8 (and B4A 8) Notifications have changed the last call after creating a notification must be with SetInfo.
(see https://www.b4x.com/android/forum/threads/b4a-v8-0-has-been-released.90828/)

If you report this error it means that you have changed something in the code so that notifications are changed after the SetInfo.
do you use B4A 8?
do you use the latest version of the notification library?
Do you use the latest version of the library?

show the code that generates the error so check
 

Marcos Alves

Well-Known Member
Licensed User
Longtime User
Hi,

I found that it's occurring in debug mode. If the app is compiled runs normally . The lib version is 0.06

The code is your sample1 without changes.

UPDATE: Only Sample2 is running after compiled. Sample1 and Sample2 don't run in debug mode.
Error is:
java.lang.RuntimeException: Cannot change properties after call to SetInfo. Initialize the notification again.
 

Star-Dust

Expert
Licensed User
Longtime User
Do you use legacy debugging?
 

Star-Dust

Expert
Licensed User
Longtime User

Marcos Alves

Well-Known Member
Licensed User
Longtime User
Then you have to make a change to the library, because it is compiled with B4A 8.0.

For previous versions you have to follow this
https://www.b4x.com/android/forum/threads/version-safe-notification.87663/
Thanks! I upgraded to V8 a week ago but had to rollback because there was a bug in Firebase Notifications, that I use... @Erel fixed the bug on sunday )) but at that time I had already rolled back and, as I need to finish a project, hadn't time up to now to try V8 again...
But, by the way: how can I change the lib to run in V7.30?
 

Star-Dust

Expert
Licensed User
Longtime User
I should do it as soon as I have the time, now I'm off-site and I'll probably be able to work on the PC over the weekend
 

peacemaker

Expert
Licensed User
Longtime User
B4A 8.3. samples does not work under Android 5. LIb v.0.06
B4X:
java.lang.RuntimeException: Unable to create service b4a.example.standout: java.lang.RuntimeException: java.lang.RuntimeException: Cannot change properties after call to SetInfo. Initialize the notification again.

Notification code must be fixed\re-compiled in the lib
 

Star-Dust

Expert
Licensed User
Longtime User
The error indicated and related to the notifications. From version B4A 8+ SetInfo must be called last.

As soon as I return to the office, I will check. But it has already been tested on Android 8.0 devices.

Are you using the attached example?
 

peacemaker

Expert
Licensed User
Longtime User
Sure, just downloaded.
 

Star-Dust

Expert
Licensed User
Longtime User
Which device are you trying on? what version of Android do you use? What is the target SDK?
 

peacemaker

Expert
Licensed User
Longtime User
MEMU emulator Android 5.1.1, your samples projects with android:targetSdkVersion="26".
In Google emulator Android 8.1 the same.
Debug mode, or release - the same.
 

Star-Dust

Expert
Licensed User
Longtime User
MEMU emulator Android 5.1.1, your samples projects with android:targetSdkVersion="26".
In Google emulator Android 8.1 the same.
Debug mode, or release - the same.
Probably the problem was that I had not published the update.
Try with version 0.07.
On my Android 8.0 device it works properly

Example 2 opens a circular menu after clicking on the Head
 

peacemaker

Expert
Licensed User
Longtime User
Indeed, was forgotten
v.0.07 works good ! THANKS

p.s. but the menu position is to be adjusted, sometimes it's centered, not around the head position.
 
Last edited:

Star-Dust

Expert
Licensed User
Longtime User
Indeed, was forgotten
v.0.07 works good ! THANKS

p.s. but the menu position is to be adjusted, sometimes it's centered, not around the head position.
I had updated the examples for the new version but not the library.
 

peacemaker

Expert
Licensed User
Longtime User
But is there way to use instead of imageview - Editview as the topmost view ?
 

Star-Dust

Expert
Licensed User
Longtime User
Yes, of course, but not with my library.
@JordiCP has developed a library that makes a floating panel.
Or through the Java code that shared @JordiCP and modify it you can get any view that fluctuates.

Of course EditText is a very special sight that already absorbs many touch events, so it requires careful design
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…