Activity OnCreate
xxxxxxxxxx
final Window win = getWindow();
win.addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
win.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON
| WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON
| WindowManager.LayoutParams.FLAG_ALLOW_LOCK_WHILE_SCREEN_ON);
Manifest
xxxxxxxxxx
<activity
android:name=".v2.ui.orderaccept.AcceptScreen"
android:exported="true"
android:label="@string/title_activity_accept_screen"
android:theme="@style/AppTheme.NoActionBar"
android:launchMode="singleInstance"/>
Call the activity
xxxxxxxxxx
val intent = Intent(context, targetclass)
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK)
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
startActivity(intent)