java - Creating a static method that builds a RadioButton returns a NullPointerExeption -
so have static
method building radiobutton:
public static radiobutton createaradiobutton() { radiobutton radiobutton = new radiobutton(null); return radiobutton; }
and have assignment statement:
radiobutton = createaradiobutton();
which gives me nullpointerexeption.
now how write static method create radiobutton perform good? doing wrong in here?
you can't pass in null context argument radiobutton
. @ least need this:
public static radiobutton createaradiobutton(context context) { radiobutton radiobutton = new radiobutton(context); return radiobutton; }
Comments
Post a Comment