I'm trying to add some text to the bottom of a PreferenceFragment. The data will will be some copyright info with a link that is used to send email. Everything compiles. When the code runs, I don't see anything on the screen. When I step through my code, I'm the textview is not a null reference, so i think that the textview access is correct. Any ideas how to get the text to be displayed or a different way to add text, or a textview, to a preference fragment.
I've got the following code in preference fragment in my OnCreate:
public override void OnCreate (Bundle savedInstanceState) { base.OnCreate (savedInstanceState);
app = (ConstructionApplication)this.Activity.Application;
_prefs = this.Activity.GetPreferences(FileCreationMode.WorldReadable);
//Load view
AddPreferencesFromResource (Resource.Xml.Preferences);
// load up my other preferences
Preference copyright = (Preference)FindPreference ("prefcopyright");
var v = copyright.GetView (null, null);
var cr = v.FindViewById<TextView> (Resource.Id.copyRightOnSettings);
cr.TextFormatted = Html.FromHtml(app.Copyright);
cr.SetBackgroundColor (Color.White);
cr.Gravity= GravityFlags.Center;
SetHasOptionsMenu (true);
}
My Resources/xml/Preferences.xml file content is: <?xml version="1.0" encoding="utf-8"?>
My Resources/Layout/PreferenceWithTextView.axml file: <?xml version="1.0" encoding="utf-8"?>