I am having a simple sample in MvvmCross
. In that, I have installed Xamarin.Forms version 3.4
and MvvmCross version 6.6.
My doubt is:
global::Xamarin.Forms.Forms.Init(this, bundle) in android Renderer ?
What is the purpose of initializing this code
global::Xamarin.Forms.Forms.Init(this, bundle)
in android renderer?
If you check the Xamarin.Forms
official quote on this it goes something like this:
The OnCreate override initializes the
Xamarin.Forms
framework by calling the Init method. This causes the Android-specific implementation ofXamarin.Forms
to be loaded in the application before theXamarin.Forms
application is loaded. In addition, theMainActivity
class stores a reference to itself in the Instance property. The Instance property is known as the localcontext
and is referenced from the PhoneDialer class.
The quote is self-explanatory but just to help you a little bit it is basically used to load the Android specific implementation that Xamarin.Forms Framework needs at Runtime.
do we have to initialize Xamarin.Forms in MvvmCross version 6.6 in android renderer?
No, you do not need to initialize this in MvvmCross, as MvvmCross does it for you in the background. For more information on how to setup MvvmCross for Xamarin.Forms check this