In Xamarin Android, how do I get the current theme name programmatically? I need to get the name as a string such as "Theme.AppCompat.Light.Dialog".
Asked
Active
Viewed 633 times
1 Answers
1
You may refer to the code bellow:
PackageInfo packageInfo;
packageInfo = PackageManager.GetPackageInfo(PackageName,PackageInfoFlags.MetaData);
int themeResId = packageInfo.ApplicationInfo.Theme;
var name = Theme.Resources.GetResourceEntryName(themeResId);
And here is the reference about how to get theme name in Android project(using java)