Skip to content

Instantly share code, notes, and snippets.

@alfianyusufabdullah
Created May 14, 2018 13:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alfianyusufabdullah/06692c85e68fea02aad9c8c636063e45 to your computer and use it in GitHub Desktop.
Save alfianyusufabdullah/06692c85e68fea02aad9c8c636063e45 to your computer and use it in GitHub Desktop.
package com.alfianyusufabdullah.produkhalal
import android.content.Context
import android.content.SharedPreferences
class SessionManager(context: Context) {
private var sharedPreferences: SharedPreferences = context.getSharedPreferences("PREF", Context.MODE_PRIVATE)
fun saveKey(key: String) {
val prefEditor = sharedPreferences.edit()
prefEditor.putString("KEY", key)
prefEditor.apply()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment