mirror of
https://github.com/jrpie/Launcher.git
synced 2025-02-23 06:21:31 +01:00
Stop timer when app is paused
I think this may fix the black screen issue. Hopefully. At least it is cleaner code than before.
This commit is contained in:
parent
83299d926f
commit
9e3cac35ae
1 changed files with 11 additions and 2 deletions
|
@ -66,6 +66,13 @@ class MainActivity : AppCompatActivity(),
|
|||
|
||||
loadSettings(sharedPref)
|
||||
|
||||
mDetector = GestureDetectorCompat(this, this)
|
||||
mDetector.setOnDoubleTapListener(this)
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
|
||||
val dateFormat = SimpleDateFormat("yyyy-MM-dd", Locale.getDefault())
|
||||
val timeFormat = SimpleDateFormat("HH:mm:ss", Locale.getDefault())
|
||||
|
||||
|
@ -75,9 +82,11 @@ class MainActivity : AppCompatActivity(),
|
|||
timeView.text = timeFormat.format(Date())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mDetector = GestureDetectorCompat(this, this)
|
||||
mDetector.setOnDoubleTapListener(this)
|
||||
override fun onPause() {
|
||||
super.onPause()
|
||||
clockTimer.cancel()
|
||||
}
|
||||
|
||||
/** Touch- and Key-related functions to start activities */
|
||||
|
|
Loading…
Add table
Reference in a new issue