AndroidSavedData/src/com/example/androidsaveddata/AndroidSavedDataActivity.java
@Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
	textView = (TextView) findViewById(R.id.counterTextView);
	preferences = getSharedPreferences(PREFERENCES_NAME, Context.MODE_PRIVATE);

        counter = preferences.getInt("counter", 0);
	textView.setText(counter + "");
    }
/** Called when the activity is first created. */
Called when the activity is first created.
Called when the activity is first created .
@Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
	textView = (TextView) findViewById(R.id.counterTextView);
	preferences = getSharedPreferences(PREFERENCES_NAME, Context.MODE_PRIVATE);
        counter = preferences.getInt("counter", 0);
	textView.setText(counter + "");
    }
@ Override public void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( R . layout . main ) ; textView = ( TextView ) findViewById ( R . id . counterTextView ) ; preferences = getSharedPreferences ( PREFERENCES_NAME , Context . MODE_PRIVATE ) ; counter = preferences . getInt ( "counter" , 0 ) ; textView . setText ( counter + "" ) ; }
Called when the activity is first created.
Called when the activity is first created .