I want to check if my app is the first time launched ? , Can Anyone help me.
Asked
Active
Viewed 54 times
1 Answers
1
Try this:
fun isFirstOpen(): Boolean {
val pref = this.getPreferences(MODE_PRIVATE)
val isFirst = pref.getBoolean("key", true)
with(pref.edit()){
putBoolean("key", false)
commit()
}
return isFirst
}

Iulian
- 38
- 5
-
If this is the first time i want to show intro screen, else I navigate into app, how can i do it ? – Phạm Hùng Sep 12 '20 at 16:19