主屏幕/发射器与Monodroid崩溃

时间:2012-03-20 18:46:23

标签: android xamarin.android startup homescreen

我正在尝试创建一个启动器/主屏幕。应用程序在重新启动时崩溃。

调试器显示:“无法获取提供程序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>

1 个答案:

答案 0 :(得分:0)

找到解决方案:

调试需要MonoRuntimeProvider。一旦我发布,它就完美地工作了......