[B4X] [XUI] AS DropDownBox - simple in app snackbar/notification/information panel
I spend a lot of time in creating views, like this and to create a high quality view cost a lot of time. If you want to support me and further views, then you can do it here by Paypal. :) Swipe to hide. ASDropDownBox Author: Alexander Stolte Version: 1.02 ASDropDownBox Events: Click...
when I implemented this library with button trigger, when clicked more than once, application Crash and show this error
error:
** Activity (main) Pause event (activity is not paused). **
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create (first time) **
Call B4XPages.GetManager.LogEvents = True to enable logging B4XPages events.
** Activity (main) Resume **
asdropdownbox$ResumableSub_Showresume (java line: 339)
java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
at android.view.ViewGroup.addViewInner(ViewGroup.java:4417)
at android.view.ViewGroup.addView(ViewGroup.java:4258)
at android.view.ViewGroup.addView(ViewGroup.java:4230)
at anywheresoftware.b4a.objects.PanelWrapper.AddView(PanelWrapper.java:65)
at anywheresoftware.b4a.objects.B4XViewWrapper.AddView(B4XViewWrapper.java:326)
at com.as.dropdownbox.asdropdownbox$ResumableSub_Show.resume(asdropdownbox.java:339)
at com.as.dropdownbox.asdropdownbox._vvvvvvvvvvvvvvvvv2(asdropdownbox.java:305)
at com.as.dropdownbox.b4xmainpage$ResumableSub_Button1_Click.resume(b4xmainpage.java:138)
at com.as.dropdownbox.b4xmainpage._button1_click(b4xmainpage.java:118)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:221)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:201)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
at android.view.View.performClick(View.java:5653)
at android.view.View$PerformClick.run(View.java:22461)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6138)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:893)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:783)
this is the code
code:
Sub Class_Globals
Private Root As B4XView
Private xui As XUI
Private ddb As ASDropDownBox
End Sub
Public Sub Initialize
End Sub
'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("frm_main")
B4XPages.SetTitle(Me,"AS DropDownBox Example")
Sleep(250)
ddb.Initialize(Me,"ddb")
ddb.Padding = 20dip 'standard is 0
ddb.ShowAlignment = ddb.ShowAlignment_TOP 'standard is TOP
ddb.ShowAnimationDuration = 250 'standard is 500
Sleep(3000)
ddb.Show(Root,"Test text only one line...")
Sleep(3000)
ddb.Hide
Sleep(3000)
ddb.Show(Root,$"B4A includes all the features needed to quickly develop any type of Android app.
B4A is used by tens of thousands of developers from all over the world, including companies such as NASA, HP, IBM and others.
Together with B4i you can easily develop applications for both Android and iOS.
B4A is 100% free."$)
End Sub
Private Sub ddb_Click
Log("click")
End Sub
Private Sub Button1_Click
ddb.Show(Root,"Test text only one line...")
Sleep(3000)
ddb.Hide
End Sub
Private Sub Button2_Click
ddb.Show(Root,$"B4A includes all the features needed to quickly develop any type of Android app.
B4A is used by tens of thousands of developers from all over the world, including companies such as NASA, HP, IBM and others.
Together with B4i you can easily develop applications for both Android and iOS.
B4A is 100% free."$)
Sleep(3000)
ddb.Hide
End Sub
i attached a modified sample code . please help
regards