AndroidAPS/app/src/main/java/info/nightscout/androidaps/activities/RequestDexcomPermissionActivity.kt
2019-08-08 18:39:56 +02:00

19 lines
616 B
Kotlin

package info.nightscout.androidaps.activities
import android.os.Bundle
import info.nightscout.androidaps.plugins.source.SourceDexcomPlugin
class RequestDexcomPermissionActivity : NoSplashAppCompatActivity() {
private val requestCode = "AndroidAPS <3".map { it.toInt() }.sum()
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
requestPermissions(arrayOf(SourceDexcomPlugin.PERMISSION), requestCode)
}
override fun onRequestPermissionsResult(requestCode: Int, permissions: Array<out String>, grantResults: IntArray) {
finish()
}
}