java - Adding an item to listpreference -


i have preference screen containing preferencelist. want user able add new friends list.

i have been unable find examples of how can achieve such thing doing run time.

does have example or able give me example of how achieve this?

here preference:

<preferencecategory android:title="your competetion">             <preferencescreen         android:key="secondprefscreen"         android:summary="click here see friends"         android:title="friends" >         <listpreference             android:key="friendlist"                 />     </preferencescreen> 

you can access listpreference object @ runtime , use setter , getter methods update entries. listpreference docs

assuming inside preferenceactivity:

   preferencescreen root = this.getpreferencescreen();    listpreference list = (listpreference) root.findpreference("secondprefscreen");    // stuff list 

Comments

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -