leithdm
5/4/2020 - 12:39 PM

SharedPreferences 101

        SharedPreferences sharedPreferences = this.getSharedPreferences("com.insertapplicationname.here", Context.MODE_PRIVATE);
        //create
        sharedPreferences.edit().putString("username", "leithdm").apply();
        //read
        String username = sharedPreferences.getString("username", "");
        Log.i("username", username);