Android programming keep screen on

2010年3月17日 星期三

You may seen numerous methods describing how to keep the screen on, they using the PowerManager.WakeLock API. But access WakeLock too often will drain the battery, here is an easy approach let Android do it for you.

Just add android:keepScreenOn="true " to your app layout .

Example:
...........
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:keepScreenOn="true">
.........


Read more...

  © Blogger template The Professional Template II by Ourblogtemplates.com 2009

Back to TOP