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.


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -