我从服务开始活动直到 android P,但是从 android10 谷歌保留了一项限制,即活动不能从后台启动。
https://developer.android.com/guide/components/activities/background-starts https://developer.android.com/guide/components/activities/background-starts
// below code stopped working
Intent intent = new Intent(this, MyActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
我应该为 Android 10 做什么?
您可以使用通知setFullScreenIntent
,这是你能做的或你能要求的最好的SYSTEM_ALERT_WINDOW
许可,但它不适用于 android go 设备。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)