EDIT 1: According to this answer, these string are not displayed, only used by accessibility services. Confusing...
I'm using Xamarin.Android.
I'm looking for a way to set the Title of an ActionBarDrawer
dynamically to a string that is unknown before the user has logged in.
For now the ActionBarDrawer is constructed with default resource ids, ie:
drawerLayout = FindViewById<DrawerLayout>(Resource.Id.drawer);
m_toggle = new ActionBarDrawerToggle(this, drawerLayout, Resource.String.options, Resource.String.main_activity);
drawerLayout.AddDrawerListener(m_toggle);
I can't seem to find a way to set the closed state title to the name of the current user.
There is only one overload of the SetTitle()
method and it takes a resource id.
So, I think my last option is to find the TextView
and change the text... I may be wrong but I would say that the TextView
as no Id. Next thing I'm thinking of is to enumerate over the layout children...
This seems to be overly complicated for such a simple task.
Is there a better option?