2013-05-07 42 views
0

我用Xamarin試用版創建了一個簡單的應用程序,它只顯示一個啓動畫面。當我在Xamarin工作室中點擊「運行」後,它部署並運行得很好,但是如果我在設備上單擊「Home」並嘗試從應用程序列表中運行應用程序 - 屏幕閃爍片刻並且應用程序終止,則不會觸發斷點在第二次運行。對於仿真器和物理設備都是如此。Xamarin.Android應用程序沒有第二次啓動

我懷疑它的問題,但我的代碼如下。

佈局:

<?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的試用版?

回答

0

好吧,它看起來像試用版確實造成我的問題。亞行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小時 - 由於某種原因立即過期。哦,我可以忍受。

更新: 沒錯,問題消失後,我購買並激活許可證。

相關問題