Update Forms.cs
authorAlan McGovern <alanmcgovern@users.noreply.github.com>
Tue, 19 Feb 2019 08:56:08 +0000 (08:56 +0000)
committerGitHub <noreply@github.com>
Tue, 19 Feb 2019 08:56:08 +0000 (08:56 +0000)
If you want a foolproof way of getting a reference to the assembly from
the Android head project, then just use the EntryAssembly
property of the AppDomain.

Xamarin.Forms.Platform.Android/Forms.cs

index b52f4c1..3309e9e 100644 (file)
@@ -70,7 +70,7 @@ namespace Xamarin.Forms
                // Why is bundle a param if never used?
                public static void Init(Context activity, Bundle bundle)
                {
-                       Assembly resourceAssembly = Assembly.GetCallingAssembly();
+                       Assembly resourceAssembly = AppDomain.GetEntryAssembly ();
                        SetupInit(activity, resourceAssembly);
                }