Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Activities in Xamarin.Android

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 176
    Comment on it

    Hello all,

    In this blog, I will continue on my previous blog What are the building blocks of Xamarin.Android , and we will discuss about the building blocks of Xamarin.

    One of the most important and interesting building block of the Xamarin.Android is Activity Class. Initially when we create our basic application, we can find the MainActivity Class and this class inherits from the Activity base class.

    This MainActivity class represents a screen of application, so every time you have a screen in you application, you are typically going to have an activity class associated with it, that allows you o interact you with the screen as well as life cycle events.

    When we create these activity, we have some very important fact that we should be aware of. The main activity class us decorated with Activity attribute, which we discussed in the previous blog, this allows Xamarin.Android to help build-up AndroidManifest.xml file for you without you having to do a lot of that by your self.

    So while decorating the Main Activity class we are specifying the label associated with the main activity and when you are using the label property associated with an activity, its going to be defaulted to be main label associated with an icon on the emulator on which the application is running upon. Than we also have the main launcher property which specifies that whether or not this is the first activity or the first screen to the to show up when user touches the icon associated with your application. We are only allowed to have one of these Main Launcher per application.

    We can also specify the icon associated with your application via your main launcher and it maps into the Resource > drawable > icon.png

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: