android - Can not resolve int in onClick ( View view ) method -


can me resolve issue?

public class pin extends actionbaractivity implements view.onclicklistener {      button btn_pin;     edittext input_pin;     int pin;      userlocalstore userlocalstore;      @override     protected void oncreate(bundle savedinstancestate) {         super.oncreate(savedinstancestate);         setcontentview(r.layout.activity_login);          btn_pin = (button) findviewbyid(r.id.btn_pin);         int pin = integer.parseint(input_pin.gettext().tostring());         input_pin = (edittext) findviewbyid(r.id.input_pin);          btn_pin.setonclicklistener(this);          userlocalstore = new userlocalstore(this);     }      @override     public void onclick(view view) {         switch (view.getid()) {             case r.id.btn_pin:                 int pin = integer.parseint(input_pin.gettext().tostring());                 user user = new user(pin);                  authenticate(user);                 break;         }     } 

the line int pin has error. don't know how fix can me?

error:(42, 29) error: no suitable constructor found user(int) constructor user.user(string,string) not applicable (actual , formal argument lists differ in length) constructor user.user(string,string,int,int,string,string) not applicable (actual , formal argument lists differ in length)

its said error:(41, 38) error: cannot find symbol variable pin how can find , make right.?

btn_pin = (button) findviewbyid(r.id.btn_pin); int pin = integer.parseint(input_pin.gettext().tostring()); input_pin = (edittext) findviewbyid(r.id.input_pin); 

you should use input_pin after findviewbyid, or nullpointerexception.


Comments