How in programming under Android (i. E. In Java with appropriate libraries) programmatically add an element (for example, a button) to the end of the container specified by id? That is, if there is already something in the container, the added element should be inserted at the end.
For those that own JavaScript : I now asked about the equivalent of the append() method of the jQuery library.
Probably, to answer my question, you just need to fix one line in the code:
// Определяем контейнер по ID RelativeLayout Contnr = (RelativeLayout) findViewById(R.id.Contnr); // Создаём новый объект (например, textInput) EditText InputTextA = new EditText(this); // Добавляем его (данный метод добавит объект в начало контейнера, // как показал эксперимент, поверх уже существующих.) Contnr.addView(InputTextA); Just in case, I will point out once again that we do not know in advance if there is something in the container and if there is one, after which of the existing objects we will add a new one.