刚开始使用 Visual Studio 2012 和 Mono droid 测试 android 应用程序开发。到目前为止一切顺利,但我注意到的第一件事是开始新项目它没有创建 AndroidManifest.xml。我发现您可以从 Project proporties 生成一个。结果:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-sdk />
<application>
</application>
</manifest>
我还注意到在自动生成的 Activity1.cs 中有几行:
[Activity(Label = "Apptest", MainLauncher = true, Icon = "@drawable/icon")]
但是当我尝试删除上面的那行代码并通过 manifest.xml 将其集成时,问题就出现了,如下所示:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-sdk />
<application android:icon="@drawable/Icon">
<activity class=".Activity1"
android:label="Apptests">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
如何在我的 AndroidManifest.xml 中正确描述 Activity1.cs?