Kotlin中使用SharedPreferences
Kotlin中使用SharedPreferences
创建类
object ShareUtil {
private var sps: SharedPreferences?=null
private fun getSps(context: Context):SharedPreferences{
if(sps==null){
sps=context.getSharedPreferences("default",Context.MODE_PRIVATE)
原创
2021-05-14 16:31:26 ·
662 阅读 ·
0 评论