Android Question ScrollView runtime error, please help!

Beja

Expert
Licensed User
Longtime User
Please tell me what's wrong with this code?

java.lang.RuntimeException: Object should first be initialized (View).


at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:46)
at anywheresoftware.b4a.samples.customlistview.main._chk_checkedchange(main.java:339)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:175)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:163)
at anywheresoftware.b4a.objects.CompoundButtonWrapper$1.onCheckedChanged(CompoundButtonWrapper.java:44)
at android.widget.CompoundButton.setChecked(CompoundButton.java:124)
at android.widget.CompoundButton.toggle(CompoundButton.java:86)
at android.widget.CompoundButton.performClick(CompoundButton.java:98)
at android.view.View$PerformClick.run(View.java:8816)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
at dalvik.system.NativeStart.main(Native Method)
java.lang.RuntimeException: Object should first be initialized (View).
 

Attachments

  • scrollview.zip
    8.7 KB · Views: 221

klaus

Expert
Licensed User
Longtime User
Haven't you looked carefully at the CreateListItem routine !?
Your routine declaratoion:
Sub CreateListItem(Text As String, Width As Int, Height As Int) As Panel
@mangojacks' declaration:
Sub CreateListItem(values() As String, Width As Int, Height As Int) As Panel
You also need to remove this line in Dim values() As String in Globals !
 
Upvote 0

Beja

Expert
Licensed User
Longtime User
Klaus,
Thanks and sorry you are right, I didn't notice the change in the function declaration, so I copied the body only..

It is now working like a charm! thanks to you and mangojack. I will repeat the same for the labels too.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…