Skip to content

Instantly share code, notes, and snippets.

@CoderJava
Last active September 14, 2018 10:07
Show Gist options
  • Select an option

  • Save CoderJava/d093d33acba4fdf5309e4db73d569053 to your computer and use it in GitHub Desktop.

Select an option

Save CoderJava/d093d33acba4fdf5309e4db73d569053 to your computer and use it in GitHub Desktop.
SharedPreferences debug
// ...
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