在mouted()里写入以下代码
//Android
var g_wakelock = null;
var main = plus.android.runtimeMainActivity();
var Context = plus.android.importClass("android.content.Context");
var PowerManager = plus.android.importClass("android.os.PowerManager");
var pm = main.getSystemService(Context.POWER_SERVICE);
g_wakelock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "ANY_NAME");
g_wakelock.acquire();
0 个回复