Android Question B4A problem with Radiobutton

Discussion in 'Android Questions' started by grafsoft, Jan 21, 2015.

  1. grafsoft

    grafsoft Well-Known Member Licensed User

    Code:
    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?
     
  2. NJDude

    NJDude Expert Licensed User

    Where are you adding the RadioButton to the activity/panel?
     
    grafsoft likes this.
  3. grafsoft

    grafsoft Well-Known Member Licensed User

    Thank you, that was the problem!
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice