Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make read only (programmatically filled) Preferences?

Tags:

android

How to make Preferences items with programmatically filled values (like: Version, Model number...)?

like image 556
yuriy Avatar asked Dec 29 '11 17:12

yuriy


1 Answers

Why not use android.preference.Preference directly?

<Preference 
 android:key="version"
 android:title="@string/version" />

No edit dialog, no more attribute, and information only!!

//Set the version string in your code 
findPreference("version").setSummary(version);
like image 74
popcorny Avatar answered Oct 21 '22 14:10

popcorny