Android Question B4A problem with Radiobutton

grafsoft

Well-Known Member
Licensed User
Longtime User
B4X:
Dim rb As RadioButton
rb.Initialize ("rb")
Dim wi,he As Int
wi=ma.Get ("wi" & i)
he=ma.Get ("he" & i)
rb.Text=wi & " x " & he
rb.Tag=i
rb.Visible=True
rb.Width=150dip

At the last line I get an error:

Error occurred on line: 89 (settings)
java.lang.NullPointerException
at anywheresoftware.b4a.objects.ViewWrapper.setWidth(ViewWrapper.java:135)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:636)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:302)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:238)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:121)
at Photo.Tagger.settings.afterFirstLayout(settings.java:98)
at Photo.Tagger.settings.access$100(settings.java:16)
at Photo.Tagger.settings$WaitForLayout.run(settings.java:76)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)

Why?
 
Top