I'm new in Android. In my app i want to do something like this: I have a container and i want to add item dynamically to it, in one item there may be some fields, so tree would be like this:
main container
- item 1
--field 1
--field 2
...
--field n
- item 2
--field 1
--filed 2
.......
- item n
--field 1
--field 2
...
field n
I want to do this using preferences, cause i need store user's info in app, but don't know how. Can you help me, please?
You need to create an xml file with an empty
PreferenceScreen
:Then in your
PreferenceFragment
you must call the following method in youronCreate(Bundle savedInstanceState) {...}
Afterwards you can add
Preference
s like this:Of course you can add preferences and categories in a loop to add them dynamically.