SharedPreferences Save value of Int in a TextView
问题 I try to save the value of an int displayed in a TextView using SharedPreferences, it can't work at all. I did a simple small example of code : public class MainActivity extends Activity { Button search; TextView tvRing; int redRing; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); final SharedPreferences prefs = getSharedPreferences("sharedPreferences", Context.MODE_PRIVATE); search = (Button)