1. Are you ready for the Galaxy S20? Here is everything we know so far!

Disable Screen Lock with my own application

Discussion in 'Android Development' started by Ashworth, Nov 26, 2009.

  1. Ashworth

    Ashworth Lurker
    Thread Starter


    Does anyone know the API to use to not lock the device while you are in your own application? I'm creating a GPS golf application when you don't always use the phone so sometimes the device and get locked. I would rather just have the screen power off, and have the phone not lock while my application is running. I know there are 3rd party applications that do this system wide, but I just care about my own app.


    1. Download the Forums for Android™ app!


  2. Loki117

    Loki117 Guest

    Yup you want a screen on wake lock but be careful this sort of lock will drain battery like no business.

  3. Ashworth

    Ashworth Lurker
    Thread Starter

    Thanks, this is what I was looking for... Did not think to look at power stuff, I was only looking at screen stuff.

    Many thanks!

Share This Page