android - If a class derives from Activity, why would it also sport an Activity decoration? -


this seems android standard:

[activity(label = "jivetomturkey", mainlauncher = true, icon = "@drawable/icon")] public class hyperactivity : activity 

...yet seems redundant - if hyperactivity inherits activity, why have tell compiler class activity?

i found this:

we mentioned earlier activities have registered in androidmanifest.xml file in order them located os, , activityattribute aids in doing that. during compilation, xamarin.android build process gathers attribute data class files in project , creates new androidmanifest.xml based on androidmanifest.xml file in project, attribute data merged in. bundles manifest resulting compiled application (apk file).

by using c# attributes, xamarin.android able keep declarative information used register activity class definition. failure include attribute result in android not being able locate activity, since not registered system.

here.


Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -