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

Popular posts from this blog

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

python - No response in ssh.exec_command in paramiko -