1

I have this attribute on one of my activities in my Xamarin project and I want to get the value of Label, which is "Requirements". How do I do that?

[Activity(Label = "Requirements", Icon = "@drawable/icon", Theme = "@style/MyTheme")]
  • This [article on Xamarin Forums](http://forums.xamarin.com/discussion/comment/69571) might help you – Malte R Oct 19 '16 at 15:09

1 Answers1

1

So this stackoverflow question shows how to do it in Android native. In C# for Xamarin you can do it like this:

var component = new ComponentName(this, Class.FromType(typeof(MainActivity)));
var activityInfo = PackageManager.GetActivityInfo(component, 0);
var label = activityInfo.NonLocalizedLabel;
Community
  • 1
  • 1
A Springham
  • 2,038
  • 1
  • 13
  • 10