2012-03-20 98 views
1

我試圖創建一個啓動器/主屏幕。應用程序在重新啓動時崩潰。Monodroid崩潰的主屏幕/發射器

調試器顯示:「Unable to get provider mono.MonoRuntimeProvider」。在啓動MonoRuntimeProvider之前,您必須等待很長時間,然後該應用才能正常工作。任何想法來解決這個問題?

Activity1.cs

[Activity(Label = "Test application", MainLauncher = true, Icon = "@drawable/icon")] 
public class Activity1 : Activity 
{ 
    int count = 1; 

    protected override void OnCreate(Bundle bundle) 
    { 
     try 
     { 


     base.OnCreate(bundle); 

     RequestWindowFeature(WindowFeatures.NoTitle); 
     Window.SetFlags(WindowManagerFlags.Fullscreen, WindowManagerFlags.Fullscreen); 


     // Set our view from the "main" layout resource 
     SetContentView(Resource.Layout.Main); 


     } 
     catch (Exception ex) 
     { 
      Log.Error("TestError","Test Error:" + ex.Message); 
     } 
     // 

    } 

的Manifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="internalOnly" package="Test.AndroidMono" android:versionCode="1" android:versionName="test"> 
    <application android:label="Test AndroidMono" > 
     <activity android:name="monoandroidapplication2.Activity1" 

       android:launchMode="singleInstance" 
       android:stateNotNeeded="true"> 
     <intent-filter> 
     <action android:name="android.intent.action.MAIN" /> 
     <category android:name="android.intent.category.HOME"/> 
     <category android:name="android.intent.category.DEFAULT" /> 
     <category android:name="android.intent.category.CATEGORY_LAUNCHER" /> 
     <category android:name="android.intent.category.LAUNCHER" /> 
     </intent-filter> 
    </activity> 

    </application> 
    <uses-sdk android:minSdkVersion="7" /> 

    <uses-permission android:name="android.permission.WAKE_LOCK" /> 
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> 
    <uses-permission android:name="android.permission.BATTERY_STATS" /> 
    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" /> 
    <uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" /> 
    <uses-permission android:name="android.permission.INTERNET" /> 
    <uses-permission android:name="android.permission.REBOOT" /> 
    <uses-permission android:name="android.permission.DEVICE_POWER" /> 

    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> 
</manifest> 
+0

我唯一不認識的是launchMode和stateNotNeeded。你可以嘗試沒有這些,看看是否有幫助。否則,添加完整的例外可能會有所幫助。 – jpobst 2012-03-20 21:04:41

回答

0

查找解決方法:

MonoRuntimeProvider需要進行調試。一旦我發佈,它的工作完美...