Answer the question
In order to leave comments, you need to log in
How to programmatically add an EditText?
Here is the code I am trying to do it:
LinearLayout LL = (LinearLayout)findViewById(R.id.section_label);
EditText ET = new EditText(this);
ET.setText("hallo hallo");
ET.setId(5);
ET.setLayoutParams(new LayoutParams(
LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT));
LL.addView(ET);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question