Tuesday, March 13, 2012

[android-developers] Re: Turn Screen Off/on

I need to save energy, i want to make the device sleep during the nigh, without user intervention....

But im having trouble when i try to wake up the device...

I tried something like that:

AlarmManager alarmManager = (AlarmManager)getSystemService(ALARM_SERVICE);

       Calendar calendar = Calendar.getInstance();
       calendar.setTimeInMillis(System.currentTimeMillis());
       calendar.add(Calendar.SECOND, 10);
       //one-shoot:
       //alarmManager.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), pendingIntent);
       //repetitive alarm:
       alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), 5*1000, pendingIntent);
           
       Toast.makeText(AndroidAlarmService.this, "Start Alarm", Toast.LENGTH_LONG).show();
  
  

Em quinta-feira, 8 de março de 2012 17h28min52s UTC-3, Yan escreveu:
Why not just display the screen black a few times???


On Tuesday, March 6, 2012 11:30:24 AM UTC-7, Levi Ribeiro wrote:
Hi, I'm trying to do a simple test, where the screen turn off and on
several times. something like that:


--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate