final touches
parent
2aae8ee5e8
commit
6c8ede60d9
@ -1,14 +1,19 @@
|
||||
package com.example.hmg_qline.hmg_qline
|
||||
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.util.Log
|
||||
|
||||
class BootReceiver : BroadcastReceiver() {
|
||||
class BootBroadcastReceiver : BroadcastReceiver() {
|
||||
override fun onReceive(context: Context, intent: Intent) {
|
||||
if (intent.action == Intent.ACTION_BOOT_COMPLETED) {
|
||||
if (intent.action == Intent.ACTION_BOOT_COMPLETED ||
|
||||
intent.action == "android.intent.action.QUICKBOOT_POWERON"
|
||||
) {
|
||||
|
||||
// Launch the app automatically on boot
|
||||
val i = Intent(context, MainActivity::class.java)
|
||||
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) // Start activity outside of an existing task
|
||||
context.startActivity(i)
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,19 @@
|
||||
package com.example.hmg_qline.hmg_qline
|
||||
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import io.flutter.embedding.android.FlutterActivity
|
||||
|
||||
class MainActivity: FlutterActivity()
|
||||
class MainActivity : FlutterActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
// var REQUEST_OVERLAY_PERMISSIONS = 100
|
||||
// if (!Settings.canDrawOverlays(applicationContext)) {
|
||||
// val myIntent = Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION)
|
||||
// val uri: Uri = Uri.fromParts("package", packageName, null)
|
||||
// myIntent.data = uri
|
||||
// startActivityForResult(myIntent, REQUEST_OVERLAY_PERMISSIONS)
|
||||
// return
|
||||
// }
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Loading…
Reference in New Issue