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

169 строки
8.5 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> [mono-android] Resuming Image
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:monodroid%40lists.ximian.com?Subject=%5Bmono-android%5D%20Resuming%20Image&In-Reply-To=CB0E05A1.CC27%25steven_john_pack%40yahoo.com.au">
<META NAME="robots" CONTENT="index,nofollow">
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
<LINK REL="Previous" HREF="007798.html">
<LINK REL="Next" HREF="007808.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[mono-android] Resuming Image</H1>
<B>Tomasz Cielecki</B>
<A HREF="mailto:monodroid%40lists.ximian.com?Subject=%5Bmono-android%5D%20Resuming%20Image&In-Reply-To=CB0E05A1.CC27%25steven_john_pack%40yahoo.com.au"
TITLE="[mono-android] Resuming Image">tomasz at ostebaronen.dk
</A><BR>
<I>Tue Dec 13 16:10:06 EST 2011</I>
<P><UL>
<LI>Previous message: <A HREF="007798.html">[mono-android] Resuming Image
</A></li>
<LI>Next message: <A HREF="007808.html">[mono-android] Porting License Verification Library to mono
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#7802">[ date ]</a>
<a href="thread.html#7802">[ thread ]</a>
<a href="subject.html#7802">[ subject ]</a>
<a href="author.html#7802">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE>How is your application structured? Are you using an activity to load
a splash screen and when the app is ready it then starts a main
activity like in the sample on Xamarins webpage?
You could maybe save a state about the app and check in OnResume
whether to show the splash screen again?
On Tue, Dec 13, 2011 at 9:52 PM, Steven Pack
&lt;<A HREF="http://lists.ximian.com/mailman/listinfo/monodroid">steven_john_pack at yahoo.com.au</A>&gt; wrote:
&gt;<i>
</I>&gt;&gt;<i>Hi All,
</I>&gt;&gt;<i>
</I>&gt;&gt;<i>I have a splash screen which shows up nicely on first run. However, if my
</I>&gt;&gt;<i>app has been killed, when it resumes, it doesn&#185;t show the splash. Rather,
</I>&gt;&gt;<i>it shows a slightly mangled version of one on of the activities.
</I>&gt;&gt;<i>
</I>&gt;&gt;<i>The activity in question has a custom title (see below), but when it's
</I>&gt;&gt;<i>being resumed, the custom TypeFace and textSize is lost, the image on the
</I>&gt;&gt;<i>left doesn't show and non-title area is just black.
</I>&gt;<i>
</I>&gt;<i> Is it meant to be showing the splash? If not, can I override the image
</I>&gt;<i> that is shown or something? It just doesn't look very slick during resume.
</I>&gt;<i>
</I>&gt;&gt;<i>
</I>&gt;&gt;<i>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
</I>&gt;&gt;<i>&lt;LinearLayout xmlns:android=&quot;<A HREF="http://schemas.android.com/apk/res/android&quot;">http://schemas.android.com/apk/res/android&quot;</A>
</I>&gt;&gt;<i> &#160; &#160; &#160; &#160; &#160; android:orientation=&quot;vertical&quot;
</I>&gt;&gt;<i> &#160; &#160; &#160; android:layout_width=&quot;fill_parent&quot;
</I>&gt;&gt;<i> &#160; &#160; &#160; android:layout_height=&quot;wrap_content&quot;&gt;
</I>&gt;&gt;<i> &#160; &#160; &#160; &#160;&lt;LinearLayout android:layout_width=&quot;fill_parent&quot;
</I>&gt;&gt;<i> &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; android:layout_height=&quot;fill_parent&quot;
</I>&gt;&gt;<i> &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; android:gravity=&quot;center_vertical|center_horizontal&quot;
</I>&gt;&gt;<i> &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; android:orientation=&quot;horizontal&quot;
</I>&gt;&gt;<i> &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &gt;
</I>&gt;&gt;<i> &#160; &#160; &#160; &#160; &#160; &#160;&lt;ImageView
</I>&gt;&gt;<i> &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; android:id=&quot;@+id/home_button&quot;
</I>&gt;&gt;<i> &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; android:layout_width=&quot;wrap_content&quot;
</I>&gt;&gt;<i> &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; android:layout_height=&quot;wrap_content&quot;
</I>&gt;&gt;<i> &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; android:src=&quot;@drawable/homeWhite&quot;
</I>&gt;&gt;<i> &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; android:layout_margin=&quot;5dp&quot;
</I>&gt;&gt;<i> &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; android:padding=&quot;4dp&quot;
</I>&gt;&gt;<i> &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; android:scaleType=&quot;fitCenter&quot;
</I>&gt;&gt;<i> &#160; &#160; &#160; &#160; &#160; &#160; &#160; /&gt;
</I>&gt;&gt;<i> &#160; &#160; &#160; &#160; &#160; &#160; &#160;&lt;TextView
</I>&gt;&gt;<i> &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; android:id=&quot;@+id/title_text_view&quot;
</I>&gt;&gt;<i> &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; android:layout_width=&quot;wrap_content&quot;
</I>&gt;&gt;<i> &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; android:layout_height=&quot;wrap_content&quot;
</I>&gt;&gt;<i> &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; android:gravity=&quot;center&quot;
</I>&gt;&gt;<i> &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; android:layout_weight=&quot;1&quot;
</I>&gt;&gt;<i> &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; android:layout_marginTop=&quot;3dp&quot;
</I>&gt;&gt;<i> &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; android:text=&quot;Dictionary&quot;
</I>&gt;&gt;<i> &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; android:textColor=&quot;@color/titletextcolor&quot;
</I>&gt;&gt;<i> &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; android:textSize=&quot;22dp&quot;
</I>&gt;&gt;<i> &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; android:paddingRight=&quot;30dp&quot;
</I>&gt;&gt;<i> &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; android:ellipsize=&quot;end&quot;
</I>&gt;&gt;<i> &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; android:singleLine=&quot;true&quot;
</I>&gt;&gt;<i> &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; /&gt;
</I>&gt;&gt;<i> &#160; &#160; &#160; &lt;/LinearLayout&gt;
</I>&gt;&gt;<i>&lt;/LinearLayout&gt;
</I>&gt;&gt;<i>
</I>&gt;&gt;<i>The Splash Activity, which shows fine first time around is defined like
</I>&gt;&gt;<i>this:
</I>&gt;&gt;<i>
</I>&gt;&gt;<i>
</I>&gt;&gt;<i>
</I>&gt;&gt;<i>[Activity (MainLauncher = true, Theme = &quot;@style/Theme.Splash&quot;, NoHistory
</I>&gt;&gt;<i>=
</I>&gt;&gt;<i>true)]
</I>&gt;&gt;<i> &#160; &#160;public class SplashActivity : Activity, ISplashView
</I>&gt;&gt;<i>
</I>&gt;&gt;<i>
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> _______________________________________________
</I>&gt;<i> Monodroid mailing list
</I>&gt;<i> <A HREF="http://lists.ximian.com/mailman/listinfo/monodroid">Monodroid at lists.ximian.com</A>
</I>&gt;<i>
</I>&gt;<i> UNSUBSCRIBE INFORMATION:
</I>&gt;<i> <A HREF="http://lists.ximian.com/mailman/listinfo/monodroid">http://lists.ximian.com/mailman/listinfo/monodroid</A>
</I>
--
Med Venlig Hilsen / With Best Regards
Tomasz Cielecki
<A HREF="http://ostebaronen.dk">http://ostebaronen.dk</A>
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI>Previous message: <A HREF="007798.html">[mono-android] Resuming Image
</A></li>
<LI>Next message: <A HREF="007808.html">[mono-android] Porting License Verification Library to mono
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#7802">[ date ]</a>
<a href="thread.html#7802">[ thread ]</a>
<a href="subject.html#7802">[ subject ]</a>
<a href="author.html#7802">[ 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>