Re: [android-developers] Re: My BroadcastReceiver receiver not getting called after phone boots, any ideas?
On Fri, Mar 8, 2013 at 3:11 PM, bob wrote: > Also, shouldn't the broadcast receiver be for ACTION_BOOT_COMPLETED and not > BOOT_COMPLETED? No. In Java, we refer to it as Intent.ACTION_BOOT_COMPLETED. The string value associated with that public static final data member is "android.intent.action.BOOT_COMPLETED". That's not to say that the manifest has no other issues. For example, the ALTERNATIVE stuff is downright bizarre. -- 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 Android Development_ Version 4.6 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 --- You received this message because you are subscribed to the Google Groups "Android Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [android-developers] Re: My BroadcastReceiver receiver not getting called after phone boots, any ideas?
Also, shouldn't the broadcast receiver be for *ACTION_BOOT_COMPLETED* and not BOOT_COMPLETED? On Friday, March 8, 2013 10:58:10 AM UTC-6, Mark Murphy (a Commons Guy) wrote: > > You do not hold the RECEIVE_BOOT_COMPLETED permission. Instead, you > are trying to hold the RECEVIE_BOOT_COMPLETED permission, which does > not exist. > > On Fri, Mar 8, 2013 at 11:12 AM, pawpaw17 > > wrote: > > Here is most of my manifest file. I changed things around so I'm trying > to > > get .MyBootAlarmReceiver to get called both when boot completes and when > the > > SD card is finished loading, but my onReceive() method doesn't seem to > be > > getting called. Any ideas? > > > > I suspect some simple goofup: > > > > > > http://schemas.android.com/apk/res/android"; > > package="x.x.x" > > android:installLocation="auto" > > android:versionCode="1" > > android:versionName="1.0.0" > > > > > > android:anyDensity="false" > > android:largeScreens="true" > > android:normalScreens="true" > > android:smallScreens="true" /> > > > > > > > > > > > android:name="android.permission.RECEVIE_BOOT_COMPLETED" /> > > > android:name="android.permission.ACTION_EXTERNAL_APPLICATIONS_AVAILABLE" > /> > > > > > android:icon="@drawable/iconmain" > > android:label="@string/app_name" > > > > > > > > android:name=".Landing" > > android:label="@string/app_name" > > android:screenOrientation="portrait" > > android:theme="@android:style/Theme.NoTitleBar" > > > > > > > > > android:name="android.intent.category.LAUNCHER" /> > > > > > > > android:name=".Products" > > android:label="@string/prod_name" > > > > > /> > > > > android:name="android.intent.category.ALTERNATIVE" > > /> > > > > > > > android:name=".SpecialEvents" > > android:label="@string/specialevents" > > > > > /> > > > > android:name="android.intent.category.ALTERNATIVE" > > /> > > > > > > > android:name=".Calories" > > android:label="@string/cal_list" > > > > > /> > > > > android:name="android.intent.category.ALTERNATIVE" > > /> > > > > > > > android:name=".coupon" > > android:label="@string/coupon" > > android:theme="@android:style/Theme.NoTitleBar" > > > > > /> > > > > android:name="android.intent.category.ALTERNATIVE" > > /> > > > > > > > > > android:name=".MyAlarmReceiver" > > android:label="Notifications" > > > > > /> > > > > android:name="android.intent.category.ALTERNATIVE" > > /> > > > > > > > android:name=".MyBootAlarmReceiver" > > android:enabled="true" > > android:exported="true" > > android:label="Notifications" > > > > > android:name="android.intent.action.BOOT_COMPLETED" > > /> > > > > android:name="android.intent.action.ACTION_EXTERNAL_APPLICATIONS_AVAILABLE" > > /> > > > > > > > > > android:name=".BrowseByType" > > android:label="@string/BrowseByType" > > > > > /> > > > > android:name="android.intent.category.ALTERNATIVE" > > /> > > > > > > > > > > > > > android:minSdkVersion="3" > > android:targetSdkVersion="14" > > > > > > > > > > > my class > > > > public class MyBootAlarmReceiver extends BroadcastReceiver { > > > > > > @Override > > public void onReceive(Context context, Intent intent) { > > > > try{ > > Log.w("DEBUG", "got the receiver"); > >Intent launchIntent = new Intent(context, MyAlarmReceiver.class); > >PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 0, > > launchIntent, 0); > > > >AlarmManager alarmManager = (AlarmManager) > > context.getSystemService(context.ALARM_SERVICE); > >long interval = 8640; // the interval is one day > >long firstTime = 0; > > > >// create a Calendar object to set the real time at which the alarm > >// should go off > >Calendar alarmTime = Calendar.getInstance(); > >Calendar now = Calendar.getInstance(); > > > > > >alarmTime.setTimeInMillis(now.getTimeInMillis() + 1); > >firstTime = alarmTime.getTimeInMillis(); > > > > >
Re: [android-developers] Re: My BroadcastReceiver receiver not getting called after phone boots, any ideas?
You do not hold the RECEIVE_BOOT_COMPLETED permission. Instead, you are trying to hold the RECEVIE_BOOT_COMPLETED permission, which does not exist. On Fri, Mar 8, 2013 at 11:12 AM, pawpaw17 wrote: > Here is most of my manifest file. I changed things around so I'm trying to > get .MyBootAlarmReceiver to get called both when boot completes and when the > SD card is finished loading, but my onReceive() method doesn't seem to be > getting called. Any ideas? > > I suspect some simple goofup: > > > http://schemas.android.com/apk/res/android"; > package="x.x.x" > android:installLocation="auto" > android:versionCode="1" > android:versionName="1.0.0" > > > android:anyDensity="false" > android:largeScreens="true" > android:normalScreens="true" > android:smallScreens="true" /> > > > > > android:name="android.permission.RECEVIE_BOOT_COMPLETED" /> > android:name="android.permission.ACTION_EXTERNAL_APPLICATIONS_AVAILABLE" /> > > android:icon="@drawable/iconmain" > android:label="@string/app_name" > > > > android:name=".Landing" > android:label="@string/app_name" > android:screenOrientation="portrait" > android:theme="@android:style/Theme.NoTitleBar" > > > > > > > > android:name=".Products" > android:label="@string/prod_name" > > > > > /> > > > android:name=".SpecialEvents" > android:label="@string/specialevents" > > > > > /> > > > android:name=".Calories" > android:label="@string/cal_list" > > > > > /> > > > android:name=".coupon" > android:label="@string/coupon" > android:theme="@android:style/Theme.NoTitleBar" > > > > > /> > > > > android:name=".MyAlarmReceiver" > android:label="Notifications" > > > > > /> > > > android:name=".MyBootAlarmReceiver" > android:enabled="true" > android:exported="true" > android:label="Notifications" > > > /> > android:name="android.intent.action.ACTION_EXTERNAL_APPLICATIONS_AVAILABLE" > /> > > > > android:name=".BrowseByType" > android:label="@string/BrowseByType" > > > > > /> > > > > > > android:minSdkVersion="3" > android:targetSdkVersion="14" > > > > > > my class > > public class MyBootAlarmReceiver extends BroadcastReceiver { > > > @Override > public void onReceive(Context context, Intent intent) { > > try{ > Log.w("DEBUG", "got the receiver"); >Intent launchIntent = new Intent(context, MyAlarmReceiver.class); >PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 0, > launchIntent, 0); > >AlarmManager alarmManager = (AlarmManager) > context.getSystemService(context.ALARM_SERVICE); >long interval = 8640; // the interval is one day >long firstTime = 0; > >// create a Calendar object to set the real time at which the alarm >// should go off >Calendar alarmTime = Calendar.getInstance(); >Calendar now = Calendar.getInstance(); > > >alarmTime.setTimeInMillis(now.getTimeInMillis() + 1); >firstTime = alarmTime.getTimeInMillis(); > > >// Repeat every day at 5pm >alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, firstTime, interval, >pendingIntent); > } > catch(Exception e){ > } > > } > > }; > > -- > -- > 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 > --- > You received this message because you are subscribed to the Google Groups > "Android Developers" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to android-developers+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > -- 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 Android Development_ Version 4.6 Available! -- --
[android-developers] Re: My BroadcastReceiver receiver not getting called after phone boots, any ideas?
Here is most of my manifest file. I changed things around so I'm trying to get .MyBootAlarmReceiver to get called both when boot completes and when the SD card is finished loading, but my onReceive() method doesn't seem to be getting called. Any ideas? I suspect some simple goofup: http://schemas.android.com/apk/res/android"; package="x.x.x" android:installLocation="auto" android:versionCode="1" android:versionName="1.0.0" > my class public class MyBootAlarmReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { try{ Log.w("DEBUG", "got the receiver"); Intent launchIntent = new Intent(context, MyAlarmReceiver.class); PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 0, launchIntent, 0); AlarmManager alarmManager = (AlarmManager) context.getSystemService(context.ALARM_SERVICE); long interval = 8640; // the interval is one day long firstTime = 0; // create a Calendar object to set the real time at which the alarm // should go off Calendar alarmTime = Calendar.getInstance(); Calendar now = Calendar.getInstance(); alarmTime.setTimeInMillis(now.getTimeInMillis() + 1); firstTime = alarmTime.getTimeInMillis(); // Repeat every day at 5pm alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, firstTime, interval, pendingIntent); } catch(Exception e){ } } }; -- -- 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 --- You received this message because you are subscribed to the Google Groups "Android Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.