I want to make a read-only EditText view. The XML to do this code seems to be android:editable=\"false\", but I want to do this in code.
H
I had no problem making EditTextPreference read-only, by using:
editTextPref.setSelectable(false);
This works well when coupled with using the 'summary' field to display read-only fields (useful for displaying account info, for example). Updating the summary fields dynamically snatched from http://gmariotti.blogspot.com/2013/01/preferenceactivity-preferencefragment.html
private static final List keyList;
static {
keyList = new ArrayList();
keyList.add("field1");
keyList.add("field2");
keyList.add("field3");
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.preferences);
for(int i=0;i