Hi,

No, it's definitely skipping it because the intent is launched. Isn't that
strange?
Seems like broadcast receivers behave somewhat oddly in general, like when
I was sending it a parcel instead of a bundle and it would not run properly.

I had to move the alarm setter code into the launched intent to get it to
run.
Seems really strange.

Thank you for your help and interest,

John Goche

On Fri, Oct 14, 2011 at 6:11 AM, Studio LFP <[email protected]> wrote:

> So it seems like it is skipping that step? Or is it just stopping before
> that step?
>
> Steven
> Studio LFP
> http://www.studio-lfp.com
>
>
>
> On Thursday, October 13, 2011 11:29:40 AM UTC-5, John Goche wrote:
>>
>>
>> Hello,
>>
>> I am having the following problem and was wondering whether
>> anyone here could be so kind so as to help me. I am having a
>> broadcast receiver in my code that opens a database and sets
>> an alarm. However the code that sets the alarm is never called
>> as shown in the adb logcat output. What is interesting is that the
>> application does not crash but the intent that is called after the
>> alarm setter was supposed to be called is run. So the intent
>> that is launched after the alarm was supposed to be set is
>> called even though I see no debug output telling me that
>> the alarm setter function is called.
>>
>> Any ideas as to what is going on?
>>
>> (please see code below)
>>
>> Thanks,
>>
>> John Goche
>>
>> public class AlarmReceiver extends BroadcastReceiver {
>>
>>   @Override
>>   public void onReceive(Context context, Intent intent) {
>>
>>     Log.d("AlarmReceiver", "received");
>>
>>     // retrieve database handle
>>
>>     DB db = DB.db(context);
>>
>>     // retrieve data from database
>>
>>     Globals.data = db.getData();
>>
>>     // reset alarms (seems like this does not get called)
>>
>>     Log.d("AlarmReceiver", "Calling alarm setter...");
>>     AlarmSetter.doSetupAlarm(**context);
>>     Log.d("AlarmReceiver", "Done.");
>>
>>     // start new intent (this actually starts up for real)
>>
>>     Intent i = new Intent(context, AlarmExpiredActivity.class);
>>     i.putExtra("alarmMessages", intent.getBundleExtra("**
>> alarmMessages"));
>>     i.addFlags(Intent.FLAG_**ACTIVITY_NEW_TASK);
>>     context.startActivity(i);
>>
>>   }
>>
>> }
>>
>> class AlarmSetter {
>>
>>   public static void doSetupAlarm(Context ctx) {
>>
>>     Log.d("AlarmSetter", "doSetupAlarm called.");
>>
>>    // ...
>>
>> }
>>
>> D/AlarmReceiver( 3805): received
>> I/ActivityManager(   61): Starting: Intent { flg=0x10000000
>> cmp=com.bar.foo/.**AlarmExpiredActivity (has extras) } from pid 3805
>>
>>
>>  --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

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

Reply via email to