Android上的睡眠模式
答
看看PowerManager及其内部类PowerManager.WakeLock。 例如,为了防止睡眠一些代码
PowerManager pm = (PowerManager) SJPhone.getContext().getSystemService(Context.POWER_SERVICE);
PowerManager.WakeLock wl = pm.newWakeLock(flags,WAKE_LOCK_STR);
wl.acquire();
// you code goes here
wl.release();
wl = null;
那是完美的,非常感谢队友把它包 – 2012-03-05 19:02:27