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

385 Views Asked by At

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.

1

There are 1 best solutions below

0
On

Solved by using onNewIntent() implementation.