Storing an int value using Shared preferences
问题 I have an int "flag" variable , which will have two possible int values , 0 & 1. Main theme of the app here is : Ask user yes or no? If user selects YES, assign int=1. else if Selects No, assign int=0; I am achieving this using: public static int flag; @Override public void onClick(View v) { // TODO Auto-generated method stub switch (v.getId()) { case R.id.flag0: flag=0; System.err.println("Flag : " + flag); break; case R.id.flag1: flag=1; System.err.println("Flag : " + flag); break; default: