Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid EditText in AlertDialog seems too wide
    primarykey
    data
    text
    <p>It seems like the EditText in the image below is too wide. I assume that I have misused the SDK in some way and until convinced otherwise I am not looking for a way to specify some number of margin/padding pixels on the sides of the <code>EditText</code>.</p> <p><img src="https://i.stack.imgur.com/qTjlm.png" alt="enter image description here"></p> <p>This one looks more appropriate.</p> <p><img src="https://i.stack.imgur.com/33Shn.png" alt="enter image description here"></p> <p>Here's my code (that creates the first, 'Create Tag', dialog):</p> <pre><code>final Dao&lt;Tag, Integer&gt; tagDao = getHelper().getTagDao(); final EditText input = new EditText(this); input.setSingleLine(true); input.setHint(R.string.create_tag_dialog_hint); AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setView(input); builder.setTitle(getString(R.string.create_tag_dialog_title)); builder.setPositiveButton( getString(R.string.create_tag_dialog_positive), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { String value = input.getText().toString().trim(); Toast.makeText(getApplicationContext(), value, Toast.LENGTH_SHORT).show(); Tag tag = new Tag(value); try { tagDao.create(tag); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }); builder.setNegativeButton( getString(R.string.create_tag_dialog_negative), null); builder.show(); </code></pre> <p>Sorry for the length of the post and thanks for any helpful comments.</p>
    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