Android examples for User Interface:EditText
Set the view of dialog with two EditTexts
import android.app.AlertDialog; import android.content.Context; import android.widget.EditText; import android.widget.LinearLayout; public class Main { /**/* w w w. j ava 2 s. com*/ * Set the view of dialog with two EditTexts * * @param alert * AlertDialog * @param editText1 * First EditText * @param editText2 * First EditText */ public static void setDialogView(Context context, AlertDialog.Builder alert, EditText editText1, EditText editText2) { LinearLayout ll = new LinearLayout(context); ll.setOrientation(LinearLayout.VERTICAL); ll.addView(editText1); ll.addView(editText2); alert.setView(ll); } }