It is possible that your problem is that the device fell asleep when doing the upload.
On Fri, Sep 30, 2011 at 4:34 AM, bobo123 <huangbo...@gmail.com> wrote: > I create a RTC_Wakeup alarm and use broadcast intent for Alarm. > I test the code on > The strange things is The OnReceive method didn't run at an alarm > time. > When I turn on the screen after alarm time, I can see the code is > being executed. > > The following are some of my code: > Activity class: > public void startAlarm() > { > Context context = AppInfo.getInstance().AppContext; > mAlarmManager = newAlarmManager(); > Intent intent=new Intent(context, OnAlarmReceiver.class); > mAlarmSender = PendingIntent.getBroadcast(context, 0, intent, > 0); > > long triggerAtTime = getTriggerTime(); > mAlarmManager.setRepeating(AlarmManager.RTC_WAKEUP, > triggerAtTime, > 24 * 60 * 60 * 1000, //one day > mAlarmSender); > } > > > > BroadcastReceiver class: > public class OnAlarmReceiver extends BroadcastReceiver{ > > public void onReceive(Context context, Intent intent) { > AlarmAlertWakeLock.acquireCpuWakeLock(context); > String currentDateTimeString = > android.text.format.DateFormat.format("yyyy-MM-dd hh:mm:ss", new > java.util.Date()).toString(); > > AutouploadPref.getInstance().logAutoupload(currentDateTimeString); > } > } > > The above code works on some device but not all. > Very strange, and don't know what happened > > -- > 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+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _The Busy Coder's Guide to *Advanced* Android Development_ Version 2.0 Available! -- 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en