responding to sleep and wake of android delphi code example
Example 1: android studio keep device awake
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
Example 2: android studio keep device awake
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);