简体   繁体   中英

android how to bring singleInstance activity to foreground when lockscreen is active

My application uses a BroadcastReceiver for monitoring charger connection. When charger is connected the application started. The main activity defined as singleInstance. In the BroadcastReceiver i'm using

it.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);

All working correctly but when lockscreen is active, the activity is "freeze" and neither onCreate nor onStart are being called.

How it can be solved? Thanks, Eyal.

通过使用onNewIntent()实现解决。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM