Reputation: 71
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")]
Upvotes: 1
Views: 809
Reputation: 2108
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;
Upvotes: 1