Open top menu






Exaplain:- How to prevent Activity going to sleep mode Android ?


Stop the activity in pause Mode .



@Overridepublic void onResume() {
    super.onResume();
    getWindow().addFlags(WindowManager.LayoutParams.
               FLAG_KEEP_SCREEN_ON);
}

@Overridepublic void onPause() {
    super.onPause();
    getWindow().clearFlags(WindowManager.LayoutParams.
              FLAG_KEEP_SCREEN_ON);
}





Tagged

0 comments