In my app there is a long loading process, and if the devices puts on the screen lock, my process stops for some reason.
How can i prevent the device from automatic screen lock?
Another way to keep the screen lock on without having to request the permission in the manifiest is:
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
Are you doing your long loading process in the UI thread? Something doesn't seem right - if the process is so long that the screen lock timesout and your process ends, perhaps it needs to go in a background service.