可以在一个后退按钮preSS可以从服务检测?按钮、preSS

2023-09-07 13:28:27 作者:归鹤鸣

能否从服务检测到后退按钮preSS?

由于头说,真的吗?我做了很多使用Google,但无法找到一个明确的答案。 也没有办法做到这一点?

解决方案   

能否从服务检测到后退按钮preSS?

没有,对不起。如果您在前台的活动,该活动可以检测到返回preSS。如果你没有在前台的活动,返回按钮无关,与你的code。

Can the a backbutton press be detected from a service?

无聊就玩玩will you press the button

As the header says really? I have done a lot of googling but can't find a definitive answer. Nor a way to do it?

解决方案

Can the a backbutton press be detected from a service?

No, sorry. If you have an activity in the foreground, the activity can detect a BACK press. If you do not have an activity in the foreground, the BACK button has nothing to do with your code.