android - How to get current entryValues from ListPreference in Fragments -
@override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { view v = inflater.inflate(r.layout.record_fragment, container, false); listpreference listpreference = (listpreference) findpreference("formats_listpref"); charsequence currtext = listpreference.getentry(); string currvalue = listpreference.getvalue(); return v; }
the method findpreference(string) undefined type browse_fragment
i want selected entryvalues listpreference, can value activity when use same code in fragments, not working findpreference(string) undefined
tried getactivity().findpreference
still showing undefined. in advance .
i check fragment extends preferencefragment i.e.
public class yourfragment extends preferencefragment { ... }
hope helps.