I’m creating an edit text :
EditText et=new EditText(this);
et.setLayoutParams(new Gallery.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
and a View :
View myView = new View(this);
I want to have (only) the EditText in this view.
How can I do it ?
The common way of putting
Views(or “UI-Elements”) on an Android Activity is to create them (in code or in XML) and put them in a Layout which is then displayed.Since you only want one
View, you can use aFrameLayout:Sample code and further information can be found in the linked docs.