0

我用 Xamarin 试用版创建了一个简单的应用程序,它只显示一个初始屏幕。在 Xamarin 工作室中点击“运行”后,它部署并运行得很好,但是如果我在设备上单击“主页”并尝试从应用程序列表中运行应用程序 - 屏幕闪烁片刻并且应用程序被终止,没有断点被击中在第二次运行。对于模拟器和物理设备都是如此。

我怀疑这很重要,但我的代码如下。

布局:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:minWidth="25px"
    android:minHeight="25px">
    <ImageView
        android:src="@drawable/splash"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:id="@+id/imageView1" />
</LinearLayout>

活动:

using Android.App;
using Android.OS;
using System;
using Android.Views;

namespace MyApplication.Activities
{
    [Activity(Label = "My application", MainLauncher = true)]
    public class SplashActivity : Activity
    {
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            RequestWindowFeature(WindowFeatures.NoTitle);
            SetContentView(Resource.Layout.Splash);
        }
    }
}

出现问题是因为它是 Xamarin 的试用版吗?

4

1 回答 1

0

好的,看起来试用版确实导致了我的问题。adb logcat 有几行:

I/ActivityManager(  308): Displayed MyApplication/MyApplication.Activities.SplashActivity: +845ms
D/Finsky  (  759): [1] 5.onFinished: Installation state replication succeeded.
I/ActivityManager(  308): START {act=android.intent.action.MAIN cat=[android.int
ent.category.LAUNCHER] flg=0x10200000 cmp=MyApplication/MyApplication.TrialSplashS
creenf2b499ae00e24b5ba2aa0253572b8e1e u=0} from pid 518
D/dalvikvm(  308): GC_FOR_ALLOC freed 1293K, 15% free 18885K/22023K, paused 66ms
, total 67ms
D/dalvikvm( 7162): Late-enabling CheckJNI
I/ActivityManager(  308): Start proc MyApplication for activity MyApplication/MyApplication.TrialSplashScreenf2b499ae00e24b5ba2aa0253572b8e1e: pid=7162 uid=10067 g
ids={3003, 1015, 1028}
I/dalvikvm( 7162): Turning on JNI app bug workarounds for target SDK version 10.
..
I/ActivityThread( 7162): Pub MyApplication.mono.MonoRuntimeProvider.__mono_init__
: mono.MonoRuntimeProvider
D/dalvikvm( 7162): Trying to load lib /data/data/MyApplication/lib/libmonodroid.s
o 0x4266ae60
D/dalvikvm( 7162): Added shared lib /data/data/MyApplication/lib/libmonodroid.so
0x4266ae60
F/MonoDroid( 7162): **This installation has expired**.
D/Zygote  (  125): Process 7162 exited cleanly (11)

虽然,试用闪屏状态,该构建将工作 24 小时 - 由于某种原因它立即到期。哦,好吧,我可以忍受。

更新:是的,在我购买并激活许可证后问题就消失了。

于 2013-05-07T13:14:22.243 回答