Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid edittext cannot enter to next edittext
    primarykey
    data
    text
    <p>I have 3 edittext in my activity. The first edittext will be setFocusable(false) if the edittext length is not equal to 0(value on 1st edittext will be from sqlite). So when I start the activity, the focus will be on the second edittext. If I click on the 1st edittext, a dialog will prompt with YES and NO button. If I click yes, it will focus on the 1st edittext and I can edit the value. But when I press the enter key on the phone keyboard, it will not direct me to the second edittext. It will stay on the 1st edittext. The only way I can go to the second edittext is to press the back button and click on the 2nd edittext. Any idea how can I fix this problem?</p> <p>Here's my code for the edittext:</p> <pre><code>if (txtBudgetText.getText().toString().length() != 0) { txtBudgetText.setFocusable(false); this.txtBudgetText = (EditText) findViewById(R.id.txtBudget); this.txtBudgetText.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { // custom dialog if ((txtBudgetText.getText().toString().length() != 0) &amp;&amp; (txtBudgetText.isFocused()==false) ) { final Dialog dialog = new Dialog(context); dialog.setContentView(R.layout.edit_budget); dialog.setTitle("Confirmation"); // set the custom dialog components - text, image and // button TextView text = (TextView) dialog .findViewById(R.id.text); text.setText("Are you sure you want to edit your budget?"); ImageView image = (ImageView) dialog .findViewById(R.id.image); image.setImageResource(R.drawable.warning); Button dialogYESButton = (Button) dialog .findViewById(R.id.dialogButtonYes); // if button is clicked, close the custom dialog dialogYESButton .setOnClickListener(new OnClickListener() { public void onClick(View v) { EditText txtBudgetText = (EditText) findViewById(R.id.txtBudget); txtBudgetText.setFocusableInTouchMode(true); txtBudgetText.setFocusable(true); txtBudgetText.requestFocus(); //txtBudgetText.setText(""); dialog.dismiss(); } }); Button dialogNOButton = (Button) dialog .findViewById(R.id.dialogButtonNo); // if button is clicked, close the custom dialog dialogNOButton .setOnClickListener(new OnClickListener() { public void onClick(View v) { dialog.dismiss(); } }); dialog.show(); } } }); } </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.
    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