mail-archives/monodroid/2011-December/007898.html

167 строки
6.3 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> [mono-android] Automatic activity start
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:monodroid%40lists.ximian.com?Subject=%5Bmono-android%5D%20Automatic%20activity%20start&In-Reply-To=1323988204280-5078857.post%40n5.nabble.com">
<META NAME="robots" CONTENT="index,nofollow">
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
<LINK REL="Previous" HREF="007889.html">
<LINK REL="Next" HREF="007905.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[mono-android] Automatic activity start</H1>
<B>Martyn Wendon</B>
<A HREF="mailto:monodroid%40lists.ximian.com?Subject=%5Bmono-android%5D%20Automatic%20activity%20start&In-Reply-To=1323988204280-5078857.post%40n5.nabble.com"
TITLE="[mono-android] Automatic activity start">Martyn.Wendon at TCSJOHNHUXLEY.COM
</A><BR>
<I>Fri Dec 16 05:24:32 EST 2011</I>
<P><UL>
<LI>Previous message: <A HREF="007889.html">[mono-android] Automatic activity start
</A></li>
<LI>Next message: <A HREF="007905.html">[mono-android] Automatic activity start
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#7898">[ date ]</a>
<a href="thread.html#7898">[ thread ]</a>
<a href="subject.html#7898">[ subject ]</a>
<a href="author.html#7898">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE>I don't believe it matters what Intent category is used, since the
OnReceive Method is never called.
I think I worked out what was happening though, at some point we added
the option for the application to be installed to SD Card and it appears
that applications installed on the SD Card may not receive the
ActionBootCompleted since the SD Card is not mounted until after the
ActionBootCompleted Intent is sent!
Removing the option for installation to SD Card got things working
again, although we then ran into another issue where the application is
being killed due to the OnReceive method taking &gt; 10 seconds to return
:<i>-(
</I>
So we're working on reducing application load time at the moment....
Thanks,
Martyn
-----Original Message-----
From: <A HREF="http://lists.ximian.com/mailman/listinfo/monodroid">monodroid-bounces at lists.ximian.com</A>
[mailto:<A HREF="http://lists.ximian.com/mailman/listinfo/monodroid">monodroid-bounces at lists.ximian.com</A>] On Behalf Of riteshsahu
Sent: 15 December 2011 22:30
To: <A HREF="http://lists.ximian.com/mailman/listinfo/monodroid">monodroid at lists.ximian.com</A>
Subject: Re: [mono-android] Automatic activity start
Have you tried using Android.Content.Intent.CategoryHome instead of
Android.Content.Intent.CategoryDefault ?
Martyn Wendon wrote
&gt;<i>
</I>&gt;<i> -----Original Message-----
</I>&gt;<i> From: <A HREF="http://lists.ximian.com/mailman/listinfo/monodroid">monodroid-bounces at .ximian</A>
</I>&gt;<i> [mailto:<A HREF="http://lists.ximian.com/mailman/listinfo/monodroid">monodroid-bounces at .ximian</A>] On Behalf Of Jonathan Pryor
</I>&gt;<i> Sent: 15 December 2011 17:03
</I>&gt;<i> To: Discussions related to Mono for Android
</I>&gt;<i> Subject: Re: [mono-android] Automatic activity start
</I>&gt;<i>
</I>&gt;<i> On Dec 15, 2011, at 11:54 AM, Martyn Wendon wrote:
</I>&gt;&gt;<i> Can anybody see any problem with the following?
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> [BroadcastReceiver]
</I>&gt;&gt;<i> [IntentFilter(new[] { Android.Content.Intent.ActionBootCompleted
</I>&gt;<i> },
</I>&gt;&gt;<i> Categories = new[] {
</I>&gt;<i> Android.Content.Intent.CategoryDefault }
</I>&gt;&gt;<i> )]
</I>&gt;&gt;<i> public class BootReceiver : BroadcastReceiver
</I>&gt;&gt;<i> {
</I>&gt;&gt;<i> public override void OnReceive(Context context, Intent
</I>intent)
&gt;&gt;<i> {
</I>&gt;&gt;<i> Log.Debug(&quot;ReceiveBoot.OnReceive&quot;, &quot;Received Intent &quot; +
</I>&gt;<i> intent.Action);
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> if ((intent.Action != null) &amp;&amp; (intent.Action ==
</I>&gt;<i> Android.Content.Intent.ActionBootCompleted))
</I>&gt;&gt;<i> {
</I>&gt;&gt;<i> Log.Debug(&quot;ReceiveBoot.OnReceive&quot;, &quot;Received
</I>&gt;<i> ActionBootCompleted Intent&quot;);
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> Android.Content.Intent start = new
</I>&gt;<i> Android.Content.Intent(context, typeof(ActivityTest));
</I>&gt;&gt;<i> start.AddFlags(ActivityFlags.NewTask);
</I>&gt;&gt;<i> context.ApplicationContext.StartActivity(start);
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i>
</I>
--
View this message in context:
<A HREF="http://mono-for-android.1047100.n5.nabble.com/Automatic-activity-start-t">http://mono-for-android.1047100.n5.nabble.com/Automatic-activity-start-t</A>
p5078121p5078857.html
Sent from the Mono for Android mailing list archive at Nabble.com.
_______________________________________________
Monodroid mailing list
<A HREF="http://lists.ximian.com/mailman/listinfo/monodroid">Monodroid at lists.ximian.com</A>
UNSUBSCRIBE INFORMATION:
<A HREF="http://lists.ximian.com/mailman/listinfo/monodroid">http://lists.ximian.com/mailman/listinfo/monodroid</A>
______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud
service.
______________________________________________________________________
______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
______________________________________________________________________
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI>Previous message: <A HREF="007889.html">[mono-android] Automatic activity start
</A></li>
<LI>Next message: <A HREF="007905.html">[mono-android] Automatic activity start
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#7898">[ date ]</a>
<a href="thread.html#7898">[ thread ]</a>
<a href="subject.html#7898">[ subject ]</a>
<a href="author.html#7898">[ author ]</a>
</LI>
</UL>
<hr>
<a href="http://lists.ximian.com/mailman/listinfo/monodroid">More information about the Monodroid
mailing list</a><br>
</body></html>