Note that there are some explanatory texts on larger screens.

plurals
  1. POSet multiple text boxes in a dialog in android
    primarykey
    data
    text
    <p>I am creating a dialog box which is like a login screen containing two text boxes and two buttons. I am able to create it but my problem is the two edit text boxes are overlapping with each other(Second edit text box is overlapping with the first one). It may be a simple one but since i m new to android i m stuck with it.Pls help me to solve it. Here is the source code</p> <pre><code>public class LoginActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Button btn= (Button) findViewById(R.id.btn_Login); btn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { showDialog(0); } }); } protected Dialog onCreateDialog(int id) { final AlertDialog.Builder alert = new AlertDialog.Builder(this); final EditText input = new EditText(this); final EditText input1 = new EditText(this); alert.setIcon(R.drawable.icon); alert.setTitle("Login"); alert.setView(input); alert.setView(input1); alert.setView(input1); alert.setPositiveButton("Ok", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { String value = input.getText().toString().trim(); Toast.makeText(getApplicationContext(), value, Toast.LENGTH_SHORT).show(); } }); alert.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { dialog.cancel(); } }); return alert.create(); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload