我收到错误:
public void save(View v){
sharedPreferences.Editor editor = sharedPreferences.edit();
editor.putString(nameKey, name.getText().toString());
editor.putString(phoneKey, phone.getText().toString());
editor.commit();
Toast.makeText(this,"data saved",Toast.LENGTH_SHORT).show();
}
我在“Editor”,“putstring”和“commit”上遇到错误。它们突出显示为红色?
有人可以帮助我吗?
答案 0 :(得分:1)
SharedPreferences.Editor editor = sharedPreferences.edit()
感谢stkent!