Browse Source

Keep screen on.

master
Robert Jacob 1 year ago
parent
commit
5f254b4d4f
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      app/src/main/java/de/hacknology/happiness/MainActivity.kt

+ 3
- 0
app/src/main/java/de/hacknology/happiness/MainActivity.kt View File

@@ -5,6 +5,7 @@ import android.content.Intent
import android.os.Bundle
import android.util.Log
import android.view.View
import android.view.WindowManager
import kotlinx.android.synthetic.main.activity_main.*
import java.io.File

@@ -14,6 +15,8 @@ class MainActivity : Activity() {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)

window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)

button_happy.setOnClickListener { saveHappiness(Happiness.HAPPY) }
button_slightly_happy.setOnClickListener { saveHappiness(Happiness.SLIGHTLY_HAPPY) }
button_slightly_unhappy.setOnClickListener { saveHappiness(Happiness.SLIGHTLY_UNHAPPY) }


Loading…
Cancel
Save