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 9149995
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T11:33:12+00:00 2026-06-17T11:33:12+00:00

I have been struggling with my Android application lately. In my application I have

  • 0

I have been struggling with my Android application lately. In my application I have a TableLayout that I dinamically populate within the app code, including an EditText in each cell and the soft keyboard’s “Next” button was not behaving correctly (jumping to the next row before getting to the other cells in the same row). So I decided to manually override the focus change by assigning IDs to the EditTexts and then using the setNextFocusDownId method to point to the next EditText. But this didn’t work either.

I’ll explain the situation.
My app has a TableLayout with three columns, this way:

EditText(1)      EditText(5)       EditText(10)
EditText(50)     EditText(100)     EditText(160)
EditText(500)    EditText(1000)    EditText(1600)
EditText(2500)   EditText(3000)    EditText(3500)
EditText(3800)   EditText(4000)    EditText(4500)

Where the numbers inside the brackets are the IDs of the EditText. While populating this TableLayout I save the list of EditTexts in an ArrayList named focusList so I can assign the NextFocus Id later. After populating the table, I call this method:

private void manageFocusList() {
    for (int i=0; i<focusList.size()-1; i++){
        focusList.get(i).setImeOptions(0x05);
        focusList.get(i).setNextFocusDownId(focusList.get(i+1).getId());
    }

    focusList.get(focusList.size()-1).setImeOptions(0x06);

}

The list of EditText is properly sorted in the ArrayList and the links between the EditTexts are succesfully done.
To test this I put some print traces when I press the Next button in the soft keyboard. This is what I get:

01-07 19:34:32.121: I/System.out(27287): My ID is: 1
01-07 19:34:32.121: I/System.out(27287): NextFocusDown: 5

01-07 19:34:32.521: I/System.out(27287): My ID is: 5
01-07 19:34:32.521: I/System.out(27287): NextFocusDown: 10

01-07 19:36:50.146: I/System.out(27287): My ID is: 10
01-07 19:36:50.146: I/System.out(27287): NextFocusDown: 50

and so on…

But in the application, it jumps this way:

1->5
5->50
50->100
100->160
160->1600
1600->1000
1000->500
500->2500

and from now on it continues doing it right

2500->3000
3000->3500
3500->3800
3800->4000
4000->4500

I tested both in a Samsung Galaxy S3 and in the emulator and the behaviour is exactly the same.
I hope you can help me!
Thank you for your time!

  • 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-17T11:33:13+00:00Added an answer on June 17, 2026 at 11:33 am

    OK, after some research, I finally found the solution, yet I don’t know what was causing this behaviour.

    I had to manually request the focus for the next edittext using the onEditorAction event listener. The only part of my code I had to change was the manageFocusList() method:

    private void manageFocusList() {
        for (int i = 0; i < focusList.size() - 1; i++) {
            focusList.get(i).setImeOptions(5);
            final int nextId = focusList.get(i + 1).getId();
            focusList.get(i).setOnEditorActionListener(
                    new OnEditorActionListener() {
                        @Override
                        public boolean onEditorAction(TextView v, int actionId,
                                KeyEvent event) {
                            if (actionId == EditorInfo.IME_ACTION_NEXT){
                                ((EditText) findViewById(nextId)).requestFocus();
                                return true;
                            }                               
                            return false;
                        }
                    });
        }
        focusList.get(focusList.size() - 1).setImeOptions(6);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing my first Android application, and I have been struggling with this
I have been struggling with setting up an iOS (Objective-C) app which utilizes the
I have a web app, that also has an iPhone and Android app using
I'm very new to programming in Android, but have been struggling all day with
What's wrong with this code ? I have been struggling to get dwb2 ColorFiltered
I'm working on an Android app. I have an Activity that checks to see
Hi android programmers, I've been struggling all day long on a problem that seems
I have been trying to embed the Jetty WebServer inside my android app so
I have been struggling with the problem. I have a Broadcast receiver that is
I have been struggling with a problem that at first glance might look easy

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.