Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 91519

Activity vs Application

$
0
0

Whats the difference b/w using Activity vs Application in Xamarin? Why would one want to use one approach over another?

For example, when I create a new Xamarin Form project in VS I get the follow:

[Activity(Label = "eApprove Main Activity", MainLauncher = true, Icon = "@drawable/eA_icon")]
public class MainActivity : Activity
{
            ...
}

I have also seen examples on internet where people are using Application class as their main Entry point:

namespace MyExpenses.Android
{
       [Application(Theme = "@android:style/Theme.Holo.Light") ]
       public class MyExpensesApplication : Application
       {
               public static Activity CurrentActivity { get; set; }

               public MyExpensesApplication(IntPtr handle, global::Android.Runtime.JniHandleOwnership transer)
                  :base(handle, transer)
              {
              }

              public override void OnCreate()
              {
                  base.OnCreate();
              }
       }
}

Viewing all articles
Browse latest Browse all 91519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>