It's on 2.2 & 2.3 devices. I've changed to context.StartActivity() but still no joy, note also that even the first Log.Debug command from the OnReceive method does nothing......so it looks like the method isn't even firing?
This is a debug build, sent to the device from within VS, the application starts up (i.e. "Start without debugging"), I then shutdown the device and power it back on again. Anything else I can check? Martyn -----Original Message----- From: monodroid-boun...@lists.ximian.com [mailto:monodroid-boun...@lists.ximian.com] On Behalf Of Jonathan Pryor Sent: 15 December 2011 17:03 To: Discussions related to Mono for Android Subject: Re: [mono-android] Automatic activity start On Dec 15, 2011, at 11:54 AM, Martyn Wendon wrote: > Can anybody see any problem with the following? > > [BroadcastReceiver] > [IntentFilter(new[] { Android.Content.Intent.ActionBootCompleted }, > Categories = new[] { Android.Content.Intent.CategoryDefault } > )] > public class BootReceiver : BroadcastReceiver > { > public override void OnReceive(Context context, Intent intent) > { > Log.Debug("ReceiveBoot.OnReceive", "Received Intent " + intent.Action); > > if ((intent.Action != null) && (intent.Action == Android.Content.Intent.ActionBootCompleted)) > { > Log.Debug("ReceiveBoot.OnReceive", "Received ActionBootCompleted Intent"); > > Android.Content.Intent start = new Android.Content.Intent(context, typeof(ActivityTest)); > start.AddFlags(ActivityFlags.NewTask); > context.ApplicationContext.StartActivity(start); Try using context.StartActivity() instead of context.ApplicationContext.StartActivity(). Another important question is this: what platform are you running on? Honeycomb changed things so that apps won't get the BOOT_COMPLETED notification unless the user has launched the app at least once, so if you just install your app then reboot the device, you won't get the notification. - Jon _______________________________________________ Monodroid mailing list Monodroid@lists.ximian.com UNSUBSCRIBE INFORMATION: http://lists.ximian.com/mailman/listinfo/monodroid ______________________________________________________________________ This email has been scanned by the Symantec Email Security.cloud service. ______________________________________________________________________ ______________________________________________________________________ This email has been scanned by the Symantec Email Security.cloud service. ______________________________________________________________________ _______________________________________________ Monodroid mailing list Monodroid@lists.ximian.com UNSUBSCRIBE INFORMATION: http://lists.ximian.com/mailman/listinfo/monodroid