how to Save value in Shared Preference : I know this que asked many time but i don't understand how to set up because i am new in android.
 
i have tried this

[1. saved prefrence][1]

[2. also use this][2]


  [1]: http://stackoverflow.com/questions/2709253/converting-a-string-to-an-integer-on-android
  [2]: http://stackoverflow.com/questions/5068115/spinner-selection-save-to-sharedpreferences-then-retrieve

**Here is my Code**

    list = new ArrayList<String>();
        list.add("Male");
        list.add("Female");

        ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(getActivity(),
                android.R.layout.simple_spinner_item, list);
        dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
       
       // int selectedPosition = gender.getSelectedItemPosition();
        gender.setSelection(sharedpreferences.getInt("Gender1", -1));
        list.indexOf(sharedpreferences.getString(Gender1, "Gender1"));
        gender.setAdapter(dataAdapter);


**Please help me**

I want to store in this value when user save his account detail

**Thank you in Advance**