 <p>I assume you want to do this in an activity class.</p> <p>You first create a new instance of <code>EditText</code>:</p> <pre><code>EditText textfield = new EditText(this); </code></pre> <p>Then you want to set the properties of the <code>EditText</code>:</p> <pre><code>textfield.setText(...); textfield.setHint(...); textfield.setLayoutParams(...); textfield.setTextSize(...); ... </code></pre> <p>After that, just add the edit text to the activity:</p> <pre><code>this.addView(textfield); </code></pre> <p>Easy! Right?</p> <p>Of course not!</p> <p>The hardest part of this is deciding how you want to layout the views. If you don't like doing that, you can use this alternative way.</p> <p>First, create an XML layout file, then use XML to design how your view will look. Let's say you want to have a <code>TextView</code> on the left and an <code>EditText</code> on the right. You just need to put a text view and an edit text in a horizontal linear layout.</p> <p>After that, get the inflated view:</p> <pre><code>View v = getLayoutInflater().inflate(R.layout.your_layout_name, null); </code></pre> <p>And add it to parent:</p> <pre><code>addView(v); </code></pre>