• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps dynamically changing text size

gavin

Lurker
I want to allow users to choose which text size to view my app in. I have a select menu which takes the value and saves it in preferences. I am updating my TextViews in my layouts using the code below:

Code:
TextView copyrightText = (TextView) findViewById(R.id.copyright);
copyrightText.setTextSize(mTextSize);
Is it possible to do the same thing for ListViews? When I uncomment the second line I get an error. I'm not sure I understand how ArrayAdapter works:

Code:
TextView list_item_text = (TextView) findViewById(R.id.list_item_text);
 //list_item_text.setTextSize(mTextSize);

String[] values = getResources().getStringArray(R.array.values_array);
ArrayAdapter<String> mArrayAdapter = new ArrayAdapter<String>(this, R.layout.list_item, values);
setListAdapter(mArrayAdapter);
ListView lv = getListView();
Thanks!
 
Back
Top Bottom