1
回答
android如何唤醒睡眠状态?
终于搞明白,存储TCO原来是这样算的>>>   

在做一个定时进入睡眠和唤醒功能,现在睡眠已经实现了,可不知道怎么唤醒,符代码:

//这是进入睡眠
PowerManager pm = (PowerManager)context.getSystemService(Context.POWER_SERVICE);
System.out.println("go to sleep: ");				    pm.goToSleep(SystemClock.uptimeMillis()); 
//用闹钟唤醒,未能实现??
AlarmManager am = (AlarmManager)getSystemService(ALARM_SERVICE);  
		Intent intent = new Intent(this, EBroadcastReceiver.class);
        PendingIntent pi = PendingIntent.getBroadcast(this, 0, intent, Intent.FLAG_ACTIVITY_NEW_TASK);  
        long now = System.currentTimeMillis();   
        am.setInexactRepeating(AlarmManager.RTC_WAKEUP, now, 10000, pi); 

举报
嘿仔晨
发帖于5年前 1回/3K+阅
顶部