I have this class
public class vartotojas {
String elpastas, slaptazodis;
public vartotojas (String elpastas,String slaptazodis)
{
this.elpastas = elpastas;
this.slaptazodis = slaptazodis;
}
}
And I am trying to use variable in this class
public class saugykla {
public static final String SP_name = "vartotojoduomenys";
SharedPreferences saugykladb;
public saugykla (Context context){
saugykladb = context.getSharedPreferences(SP_name, 0);
}
public void saugoti (vartotojas user){
SharedPreferences.Editor SP_editor = saugykladb.edit();
SP_editor.putString("elpastas", vartotojas.elpastas);
}
}
I get error on the last line vartotojas.elpastas
what I am doing wrong after I put dot after vartotojas
I get no option to choose elpastas I am fallowing tutorial on youtube I did exactly the save as youtuber did... I get error : error: non-static variable elpastas cannot be referenced from a static context