I have developed an App that loads automatically when smartphone receives an SMS message.
Problem is that when screen's phone is off or in "black" mode, App doesn't load when SMS arrives. I need that my app turns screen on programmatically. Is that possible? I found several past solutions but no one has worked.
WindowManager.LayoutParams params =
params.flags |= WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON;
params.screenBrightness = 0;
And no success.
I've been advised that this code could do the trick:
However, Android Studio shows me error:
Cannot resolve symbol 'FLAG_SHOW_WHEN_LOCKED'
Is there any import or setting that I should do?