Custom Notification

前端 未结 2 809
后悔当初
后悔当初 2021-01-21 12:29

I would like to know if there is a way of using the notication bar in order to do some operations (onClick), without having an activity being launched/resumed.

for examp

2条回答
  •  臣服心动
    2021-01-21 13:07

    I don't believe this is possible or, at the very least, best practice. It's possible that Android could kill your activity while the Notification is still waiting in the top bar. For example maybe you get a phone call but Android is low on RAM - it kills your activity, thus there's really not a 'current' activity anymore.

提交回复
热议问题