<receiver
android:name=".MyBootCompletedReceiver"
android:enabled="true">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
the notification itself does show when i manually start my app
class MainActivity : WearableActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
Notification(this, applicationContext).show()
}
}
but the notification does not show when the device boots up
class MyBootCompletedReceiver : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) {
Log.e("NotificationCreator", "ON BOOT RECIEVED")
Notification(MainActivity(), context).show()
}
}
ahh must be some process thingie. Is it relatwd with boot permission as well? (I presume there is one)
Обсуждают сегодня