Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8260449
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T03:06:08+00:00 2026-06-08T03:06:08+00:00

I have 3 edittext in my activity. The first edittext will be setFocusable(false) if

  • 0

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?

Here’s my code for the edittext:

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) && (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();
                }
            }
        });
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T03:06:10+00:00Added an answer on June 8, 2026 at 3:06 am

    add txtBudgetText.setImeOptions(EditorInfo. IME_ACTION_NEXT); after you called findViewById or set it in your layout.xml by setting android:imeOptions="actionNext" in your EditText layout declaration.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my application I have a autocomplete in first activity and some edittext in
I had put a String value (Edittext input from user in my Search-Activity) in
friends, i have a EditText on simple activity with a button. when every i
I have an activity that shows some TextView s and EditText s, as well
I have an activity that contains several user editable items (an EditText field, RatingBar,
I have an Activity in Android, with two elements: EditText ListView When my Activity
I have two activities; Home is my first activity and Settings is my second
I'm writing my first Android application and I have one activity that I'd like
I have a simple activity with only one edittext which was set to http://
I have a login screen in the first activity of my android application. When

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.