Last active
September 14, 2018 10:07
-
-
Save CoderJava/d093d33acba4fdf5309e4db73d569053 to your computer and use it in GitHub Desktop.
SharedPreferences debug
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ... | |
| button_shared_preferences.setOnClickListener { | |
| val sharedPreferences = getSharedPreferences("DATA_PREF", Context.MODE_PRIVATE) | |
| val waktu = SimpleDateFormat("dd-MM-yyyy HH:mm:ss", Locale.US) | |
| .format(Date()) | |
| sharedPreferences.edit() | |
| .putString("waktu", waktu) | |
| .apply() | |
| } | |
| // ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment