20170302

import android.content.SharedPreferences;

import android.os.Bundle;

import android.support.v7.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity {

     protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_main);

        SharedPreferences pref=getSharedPreferences("Preferences",MODE_PRIVATE); 

        SharedPreferences.Editor editor=pref.edit();

        editor.putString("text","aaaaaaaaaaaaaaa");

        editor.commit();

        System.out.println(pref.getString("text",""));

     }

}