KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
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 EditText . This one looks more appropriate. Here's my code (that creates the first, 'Create Tag', dialog): final Dao<Tag, Integer> 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(); Sorry for the length of the post and thanks for any helpful comments.
Tags (comma-separated)
Save Edits
Cancel