I am working on app tha have AppLockService Service and that called after boot completed by the MyBrodcastReciver.
when i reboot there is no receiver work
`class MyBrodcastReciver:BroadcastReceiver(){
override fun onReceive(p0: Context?, p1: Intent?) {
if(p1?.action==Intent.ACTION_BOOT_COMPLETED) {
Log.i("UURR", "Boot Completed")
val intent2 = Intent(p0, AppLockService::class.java)
intent2.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
p0?.startForegroundService(intent2)
else
p0?.startService(intent2)
}
}
}
I am try to handle this case
I heard that is the receiver have restrictions in android 13, is there any another solution or how i can make my Service working suberate from the app?
New contributor
Mohammed Ali is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.