Android Screen Timeout

前端 未结 4 796
感情败类
感情败类 2020-11-30 06:45

I know its possible to use a wakelock to hold the screen, cpu, ect on but how can I programmatically change the \"Screen Timeout\" setting on an Android ph

4条回答
  •  悲哀的现实
    2020-11-30 07:34

    Above is correct:

    Settings.System.putInt(getContentResolver(),Settings.System.SCREEN_OFF_TIMEOUT, DELAY); 
    

    But also include permission in manifest:

    android:name="android.permission.WRITE_SETTINGS"
    

提交回复
热议问题