#DesignerProperty: Key: AC, DisplayName:Activity, FieldType: Activity, DefaultValue: AC, Description: The Activity
creates this error
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Error occurred on line: 31 (AutoComplete2)
java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.ViewParent android.view.View.getParent()' on a null object reference
at android.view.ViewGroup.addViewInner(ViewGroup.java:4186)
at android.view.ViewGroup.addView(ViewGroup.java:4040)
at android.view.ViewGroup.addView(ViewGroup.java:4016)
at anywheresoftware.b4a.objects.PanelWrapper.AddView(PanelWrapper.java:65)
at b4a.example.autocomplete2._designercreateview(autocomplete2.java:192)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:710)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:339)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:139)
at b4a.example.main.afterFirstLayout(main.java:102)
at b4a.example.main.access$000(main.java:17)
at b4a.example.main$WaitForLayout.run(main.java:80)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5835)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
** Activity (main) Resume **
this is my designer code
Public Sub DesignerCreateView (Base As Panel, Lbl As Label, Props As Map)
mBase = Base
mBase.AddView(Props.Get("AC"),mBase.Left,mBase.Top,mBase.Width,mBase.Height)
CreateGUI
End Sub
Private Sub CreateGUI
mBase.Color = Colors.Transparent
et.Initialize("et")
mBase.AddView(et, 0, 0, mBase.Width, mBase.Height)
et.SingleLine = True
et.TextSize = 14 * TextSizeScaleFactor
'pnlBelow.Initialize("below")
'mBase.AddView(pnlBelow,mBase.Left,200,mBase.Width,400)
'pnlBelow.Color = Colors.Yellow
lv.Initialize("lv")
mBase.AddView(lv,et.Left,et.Top+et.Height+10,et.Width,400)
lv.AddSingleLine("Hello")
'setKBSuggestions(mKBSuggestions)
'setForceDoneButton(mForceDoneButton)
'setKBFullScreen(mKBFullScreen)
'SetEditTextNoUI(etForeground)
End Sub