I am developing an app, where i want the screen to be unlocked as long as my app is running. This is what i have tried,
@Override
protected void onResume()
{
Log.e("inside","main onre");
//for avoiding screen locking
Window wind;
// TODO Auto-generated method stub
super.onResume();
wind = this.getWindow();
wind.addFlags(android.view.WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);
wind.addFlags(android.view.WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);
wind.addFlags(android.view.WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
}
Evrything works fine, but the problem is when i move from one activity to another activity, the lock screen comes to the foreground for a fraction of a second and goes background again, which makes the transition look ugly. How can i avoid this?
Let me know, thanks!