Use a Scrollview or custom list view
(I am just about ready to give up! Sorry, had to get that off my chest.)
I did just as Don suggested. I have narrowed it down to as little code as possible. I have 1 forum example that works perfectly. I cut my code down to match the example, and it continues to tell me that in MY code a panel has not been initialized. Identical example code does NOT give the message. Error messages are:
** Service (starter) Create **
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Error occurred on line: 13 (Main)
java.lang.RuntimeException: Object should first be initialized (Panel).
at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:50)
at anywheresoftware.b4a.objects.ViewWrapper.getHeight(ViewWrapper.java:143)
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:702)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:336)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:246)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
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:815)
at android.os.Handler.dispatchMessage(Handler.java:104)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5666)
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:959)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:754)
** Activity (main) Resume **
MyCode : (Gives Error)
Sub Process_Globals
End Sub
Sub Globals
Dim scvTest As ScrollView
Dim pnlTest As Panel
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Main")
scvTest.Panel.LoadLayout("category_view")
' scvTest.Panel.Height = pnlTest.Height
scvTest.Panel.Height=pnlTest.Height
End Sub
Sub Activity_Resume
End Sub
Sample Code : (No Error)
Sub Process_Globals
End Sub
Sub Globals
Dim scvTest As ScrollView
Dim pnlTest As Panel
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Main")
scvTest.Panel.LoadLayout("ScrollViewLayout")
scvTest.Panel.Height = pnlTest.Height
End Sub
Sub Activity_Resume
End Sub
I am also including all BAL files. Note that the first "main.bal" is for my code, the second "main.bal" is from the sample. Sorry to have so much here but I am at my wits end!
Thank You.
Bobby