Ich habeWie registriere ich meine eigene Anwendung Unterklasse in Xamarin.Android?
public class MyApp : Application
In Java ich eine Linie zum Manifest hinzufügen würde und es den Namespace und den Namen meiner Anwendung übergeben:
<application android:icon="@drawable/icon" android:label="@string/app_name"
android:name="com.devahead.extendingandroidapplication.MyApplication">
In Xamarin gibt es das [Application]
Attribut aber die Dokumentation gibt an, dass das Name
Mitglied not supported ist. Wie bekomme ich meine Unterklasse registriert? Wo soll das Attribut angewendet werden?
Wenn ich das Attribut auf meine Unterklasse hinzufügen, die ich erhalten:
System.NotSupportedException: Unable to activate instance of type TestClient_Android.MyApplication from native handle 14d00019
Tis wirklich schwer zu finden Sie die Antwort so für Mono/Xamarin android –
Die Notation fand ich [hier] (http://Stackoverflow.com/a/9963637/426227) oder [hier] (https://manski.net/2012/04/ creating-a-application-class-in-mono-für-android /) ist etwas anders ('javaReference' anstelle von' handle'). Macht das einen Unterschied? – testing
@ testing, wie Sie die Parameter benennen, spielt keine Rolle. Die Typen müssen übereinstimmen. – Krumelur