Forum Xamarin.Android

could not load type invoker

BrunoVTBrunoVT BEUniversity ✭✭


When I want to get the applicationname in my custom view class I somethimes get above exception for the packagemanager in the context. Any suggestions?

var name = Application.Context.PackageManager.GetApplicationLabel(Application.Context.PackageManager.GetApplicationInfo(Application.Context.ApplicationInfo.PackageName, 0));


  • YkshLeoYkshLeo USMember ✭✭✭✭

    @BrunoVT Try something like this :

        public static string GetApplicationName(Android.Content.Context context)
          int stringId = context.ApplicationInfo.LabelRes;
          return context.GetString(stringId);
Sign In or Register to comment.