Made the IP Address Dynamic
parent
64e9d48d82
commit
61261d9412
@ -0,0 +1,14 @@
|
|||||||
|
package com.example.queuing_system
|
||||||
|
import android.content.BroadcastReceiver
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
|
||||||
|
class BootReceiver: BroadcastReceiver() {
|
||||||
|
override fun onReceive(context: Context, intent: Intent) {
|
||||||
|
if (intent.action == Intent.ACTION_BOOT_COMPLETED) {
|
||||||
|
val i = Intent(context, MainActivity::class.java)
|
||||||
|
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||||
|
context.startActivity(i)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,6 +1,24 @@
|
|||||||
package com.example.queuing_system
|
package com.example.queuing_system
|
||||||
|
|
||||||
|
import android.content.Intent
|
||||||
|
import android.net.Uri
|
||||||
|
import android.os.Build
|
||||||
import io.flutter.embedding.android.FlutterActivity
|
import io.flutter.embedding.android.FlutterActivity
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.provider.Settings
|
||||||
|
import androidx.annotation.RequiresApi
|
||||||
|
|
||||||
class MainActivity: FlutterActivity() {
|
class MainActivity: FlutterActivity() {
|
||||||
|
@RequiresApi(Build.VERSION_CODES.M)
|
||||||
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue