AndroidAPS/app/src/main/java/info/nightscout/androidaps/activities/RequestDexcomPermissionActivity.kt

21 lines
681 B
Kotlin
Raw Normal View History

2019-06-19 01:38:55 +02:00
package info.nightscout.androidaps.activities
import android.os.Bundle
2020-04-24 12:00:31 +02:00
import info.nightscout.androidaps.plugins.source.DexcomPlugin
import javax.inject.Inject
2019-06-19 01:38:55 +02:00
2020-01-26 18:17:00 +01:00
class RequestDexcomPermissionActivity : DialogAppCompatActivity() {
2020-04-24 12:00:31 +02:00
@Inject lateinit var dexcomPlugin: DexcomPlugin
2019-06-19 01:38:55 +02:00
private val requestCode = "AndroidAPS <3".map { it.toInt() }.sum()
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
2020-04-24 12:00:31 +02:00
requestPermissions(arrayOf(DexcomPlugin.PERMISSION), requestCode)
2019-06-19 01:38:55 +02:00
}
override fun onRequestPermissionsResult(requestCode: Int, permissions: Array<out String>, grantResults: IntArray) {
finish()
}
}