B4A Library [Lib] BetterDialogs

Kevin

Well-Known Member
Licensed User
Longtime User
Forgive me if this is evident in a demo or something, but is it possible to combine the features of a custom dialog (specifically a custom title bar and custom buttons) with your built-in dialogs? I like the custom dialog in that I can use custom buttons but then they do not size or internally scroll automatically. I am referring to just a simple text-only dialog, without any extra controls.
 

Informatix

Expert
Licensed User
Longtime User
I'm not sure to understand.
 

MMORETTI964

Member
Licensed User
Longtime User
Hi @Informatix

I tried it but seems doesn't work.
Give me an exception even I only declared the BD variable.
I need some other updated library than MaskedEditText (1.30)?

java.lang.ClassNotFoundException: flm$b4a$betterdialogs$BetterDialogs
at anywheresoftware.b4a.shell.Shell.getCorrectClassName(Shell.java:544)
at anywheresoftware.b4a.shell.Shell.createObject(Shell.java:516)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:320)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:238)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:121)
at flm.b4a.testdialogs.main.initializeGlobals(main.java:264)
at flm.b4a.testdialogs.main.afterFirstLayout(main.java:95)
at flm.b4a.testdialogs.main.access$100(main.java:16)
at flm.b4a.testdialogs.main$WaitForLayout.run(main.java:76)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:157)
at android.app.ActivityThread.main(ActivityThread.java:5335)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
at dalvik.system.NativeStart.main(Native Method)
 
Last edited:

Informatix

Expert
Licensed User
Longtime User
Sorry but I don't know why you get this error. I tested my library with at least 6 different devices and OS (from Gingerbread to Lollypop). Did you try the demo or your own app?
 

MMORETTI964

Member
Licensed User
Longtime User
Sorry but I don't know why you get this error. I tested my library with at least 6 different devices and OS (from Gingerbread to Lollypop). Did you try the demo or your own app?

Even in my code and in your example, too.
In my libs I see:
BetterDialogs (2.00)
Core (3.80)
Reflection (2.40)

Even in rapid and legacy mode
 

MMORETTI964

Member
Licensed User
Longtime User
I've tried on another PC of my colleague with another device (SAMSUNG 7 with KitKat), mine is attached to SAMSUNG NOTE 3 with kitkat, the error is the same.

RAPID:
** Activity (main) Create, isFirst = true **


** Activity (main) Resume **


java.lang.ClassNotFoundException: flm$b4a$betterdialogs$BetterDialogs


at anywheresoftware.b4a.shell.Shell.getCorrectClassName(Shell.java:544)
at anywheresoftware.b4a.shell.Shell.createObject(Shell.java:516)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:320)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:238)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:121)
at flm.b4a.testdialogs.main.initializeGlobals(main.java:264)
at flm.b4a.testdialogs.main.afterFirstLayout(main.java:95)
at flm.b4a.testdialogs.main.access$100(main.java:16)
at flm.b4a.testdialogs.main$WaitForLayout.run(main.java:76)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:157)
at android.app.ActivityThread.main(ActivityThread.java:5335)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
at dalvik.system.NativeStart.main(Native Method)




LEGACY:
main_globals (java line: 651)


java.lang.NoClassDefFoundError: flm.b4a.betterdialogs.BetterDialogs


at flm.b4a.testdialogs.main._globals(main.java:651)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:174)
at flm.b4a.testdialogs.main.initializeGlobals(main.java:264)
at flm.b4a.testdialogs.main.afterFirstLayout(main.java:95)
at flm.b4a.testdialogs.main.access$100(main.java:16)
at flm.b4a.testdialogs.main$WaitForLayout.run(main.java:76)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:157)
at android.app.ActivityThread.main(ActivityThread.java:5335)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
at dalvik.system.NativeStart.main(Native Method)
 

Informatix

Expert
Licensed User
Longtime User
I just tried on a Samsung S4 under Jellybean (in case it is related to Samsung devices) and got no issue, whatever mode I used.
I don't have Samsung devices running under KitKat.
 

MMORETTI964

Member
Licensed User
Longtime User
I just tried on a Samsung S4 (in case it is related to Samsung devices) and got no issue, whatever mode I used.

In the second PC I've tried, I redownload your library, peraphs Erel could solve the mistery.

RELEASE
LogCat connected to: 1af4b817
--------- beginning of /dev/log/system


--------- beginning of /dev/log/main


main_globals (java line: 486)


java.lang.NoClassDefFoundError: flm.b4a.betterdialogs.BetterDialogs
at flm.b4a.testdialogs.main._globals(main.java:486)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:174)
at flm.b4a.testdialogs.main.initializeGlobals(main.java:264)
at flm.b4a.testdialogs.main.afterFirstLayout(main.java:95)
at flm.b4a.testdialogs.main.access$100(main.java:16)
at flm.b4a.testdialogs.main$WaitForLayout.run(main.java:76)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:157)
at android.app.ActivityThread.main(ActivityThread.java:5335)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
at dalvik.system.NativeStart.main(Native Method)

...
How about give us a dialog timer? Having B4A Timer not working, should a java timer work with Dialog?
(as usual) Thank you.
 

Informatix

Expert
Licensed User
Longtime User
The new version includes a parameter (Duration) to dismiss the dialog after the given time is elapsed.
 

MMORETTI964

Member
Licensed User
Longtime User
In some circumstances (after a touch on my customedit) it appears a keyboard. I would like to hide that keyboard (my keyboard is the dialog). Something like that:

Sub customedit2_FocusChanged (HasFocus As Boolean)
If HasFocus Then
'CallSubDelayed(Me,"timerkeyboard_tick")
TimerKeyboard.interval=1
TimerKeyboard.Enabled = True
End If
End Sub

Sub customedit2_Click
TimerKeyboard_tick
'CallSubDelayed(Me,"timerkeyboard_tick")
'TimerKeyboard.Interval=1
'TimerKeyboard.Enabled = True
End Sub

Sub TimerKeyboard_tick
TimerKeyboard.Enabled = False
Dim p As Phone
p.HideKeyboard(ActivityLib)
End Sub
 

Informatix

Expert
Licensed User
Longtime User
It is quite normal that a keyboard opens when you enter an EditText. If you want that your text cannot be edited with the keyboard (and thus avoid opening it), use my MaskedEditText lib and set ReadOnly to true. You will only be able to set a new text programmatically.
 

Informatix

Expert
Licensed User
Longtime User
If the library was compiled with Java 7 then you need to:
- Reference Java 7 under Tools - Configure Paths.
- Use B4A v3.82+.
Indeed.
The path with the latest version is: C:\Program Files\Java\jdk1.7.0_71\bin\javac.exe

Android is compatible with Java 7 since October 2013, so I thought everybody was already compiling with Java 7 and that I was one of the last to keep Java 6 until this week. From now on, I will always compile with Java 7. Java 6 is no longer on my HD.
 

MMORETTI964

Member
Licensed User
Longtime User
If the library was compiled with Java 7 then you need to:
- Reference Java 7 under Tools - Configure Paths.
- Use B4A v3.82+.

I have the following path:
C:\Program Files (x86)\Java\jdk1.7.0_03\bin\javac.exe

But... I should change / update it?
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…