android - how can i use Tab and Preference? -


my english bad.. if question strange.. understand me..

first current ui using preference setting. way menu depth deep.. if user want go first menu, click many button.

so used tabhost , each tab shows list(using preference tag) if user click list item , tab disappear , shows preference ui.

how can use tab preference ?

preferences default not have tab support. need write yourself.

basically on each tab inflate , use different preferences.xml file, form whole preferences need set:

public class preferences extends preferenceactivity {      /** called when activity first created. */     public void oncreate(bundle savedinstancestate) {         super.oncreate(savedinstancestate);         addpreferencesfromresource(r.xml.preferences); // <<-- here     } 

and either depending on tab create different preferences activities or pass name of file instantiate in constructor, need 1 class handle this.


Comments