[mono-android] Automatic activity start

riteshsahu rsahu at epicor.com
Thu Dec 15 17:30:04 EST 2011


Have you tried using Android.Content.Intent.CategoryHome instead of
Android.Content.Intent.CategoryDefault ?


Martyn Wendon wrote
> 
> -----Original Message-----
> From: monodroid-bounces at .ximian
> [mailto:monodroid-bounces at .ximian] 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);
> 
> 
> 


--
View this message in context: http://mono-for-android.1047100.n5.nabble.com/Automatic-activity-start-tp5078121p5078857.html
Sent from the Mono for Android mailing list archive at Nabble.com.


More information about the Monodroid mailing list