S
S
suda9112016-02-20 14:54:02
Java
suda911, 2016-02-20 14:54:02

How to make a custom list of options?

The idea is this: there is an Activity with several EditText to enter parameters. And there is something similar to tincture. In the setting, the Activity is exactly the same, but its main difference is that there is a checkbox or something like that opposite each input parameter. This is necessary in order to be able to select the parameters that will be displayed in the Activity, where they will actually be entered. The most important requirement for this is that when the icon is removed, or simply when it is absent, the list is shifted, and there are no empty spaces left. In general, that everything would go in a row. And how and where can you store it, or is it not a setting at all and when you restart everything will be as it was set? How can this be done?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Denis Zagaevsky, 2016-02-20
@suda911

Well, if in a simple way, then you can store it in Preferences, this is enough for such a task. Can be stored in a database, SQLite, for example. It depends on the task, there are different options.
You can display it in a ListView, as mentioned above. To do this, set the adapter to only those elements that need to be displayed.
Not an option for your case, but worth knowing - View has a visibility property (andoir:visibility in the markup and get/setVisibility() in the code). Can be View.VISIBLE/INVISIBLE/GONE. INVISIBLE and GONE differ in that INVISIBLE View still takes up screen space, while GONE does not.

D
Dekker8, 2016-02-20
@Dekker8

If I understood the task correctly, then it’s probably right to do it through the ListView in each item, display the setting item and, with certain actions, delete the ListView item ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question