Greetings,
I'm trying to change the background colour of a B4XDialog I started to use but the app crashes with this error in the logs. It crashes on the comented out line.
I would also like to make the dialog have rounded corners if that's possible so it matches the rest of the app.
I'm trying to change the background colour of a B4XDialog I started to use but the app crashes with this error in the logs. It crashes on the comented out line.
B4X:
java.lang.NumberFormatException: For input string: "(GradientDrawableWithCorners) anywheresoftware.b4a.objects.drawable.ColorDrawable$GradientDrawableWithCorners@e4beb1"
at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2043)
at sun.misc.FloatingDecimal.parseDouble(FloatingDecimal.java:110)
at java.lang.Double.parseDouble(Double.java:538)
at anywheresoftware.b4a.BA.ObjectToNumber(BA.java:684)
at b4a.natures.song.b4xmainpage$ResumableSub_ButtonClearCreatureSettings_Click.resume(b4xmainpage.java:426)
at b4a.natures.song.b4xmainpage._buttonclearcreaturesettings_click(b4xmainpage.java:399)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:213)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:193)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
at android.view.View.performClick(View.java:7869)
at android.widget.TextView.performClick(TextView.java:14958)
at android.view.View.performClickInternal(View.java:7838)
at android.view.View.access$3600(View.java:886)
at android.view.View$PerformClick.run(View.java:29362)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:8125)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)
Code to call and respond to the B4XDialog:
Sub ButtonClearCreatureSettings_Click
Dim p As B4XView = xui.CreatePanel("")
cdBackgroundColour.Initialize(Colors.ARGB(150, 0, 0, 0), 0)
' p.Color = cdBackgroundColour ' Assign the colour to panel.
p.SetLayoutAnimated(0, 0, 50dip, 300dip, 150dip)
p.LoadLayout("NotificationWindow")
LabelNotification.Text = "Are you sure you want to clear the creature settings?"
dialog.Title = "Clear Creature Settings"
dialog.PutAtTop = True
Wait For (dialog.ShowCustom(p, "OK", "", "CANCEL")) Complete (Result As Int)
If Result = xui.DialogResponse_Positive Then
Log("Ok to clear.")
End If
End Sub
I would also like to make the dialog have rounded corners if that's possible so it matches the rest of the app.
Last edited: