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

  • Home
  • SEARCH
  • 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 6611733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:00:30+00:00 2026-05-25T20:00:30+00:00

I have a Scrollview as a parent view, within that i have placed some

  • 0

I have a Scrollview as a parent view, within that i have placed some mixture of linear layout
and there is no probs in the design, but while testing the app, i found that there is a problem in movement of cursor, my intention is to move the focus from one edit text to another that is located adjecent(Horizontally), but when i click the enter button at the bottom, it moves the focus to the next edit text that is vertically located (I knoe,this is default one).

Even i tried with implementing the EditorAction, still the same issue exists.

This is the code that i used to move the focus from one edit text to another.

// Adding the special listener, to be invoked when the action is performed on the editor
    firstEditText.setOnEditorActionListener(new OnEditorActionListener() {

    @Override
    public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
            // TODO Auto-generated method stub
            if(actionId == EditorInfo.IME_ACTION_UNSPECIFIED || actionId == EditorInfo.IME_ACTION_NEXT) {
            // Move the focus to the next edittext(secondEditText)
                   secondEditText.requestFocus();

            }
            return false;
        }
    });

Please let me know, how to move the focus from one text box to another placed in a horizontal direction. The above code moves the focus to text box that is vertically located. I tried with searching google a lot, but no results.

I have also shared that screen for better clarity.

Hope i could get a better response here.

Thank you

enter image description here

  • 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-05-25T20:00:31+00:00Added an answer on May 25, 2026 at 8:00 pm
    public abstract void onFocusChange (View v, boolean hasFocus){
    if(!hasFocus){
    secondEditText.requestFocus();
    }
    
    }
    

    but fails when scrolled up coz, even in that case the second EditText gets focus and not the above view..

    a better solution could be,

    GestureDetector.OnGestureListener lis = new GestureDetector.OnGestureListener(){
    
                @Override
                public boolean onDown(MotionEvent arg0) {
                    if(firstEditText.hasFocus){
                                         secondEditText.requestFocus();
                                          return true;
                                       }
                    return false;
                }
    
                @Override
                public boolean onFling(MotionEvent e1, MotionEvent e2,
                        float velocityX, float velocityY) {
                    // TODO Auto-generated method stub
                    return false;
                }
    
                @Override
                public void onLongPress(MotionEvent e) {
                    // TODO Auto-generated method stub
    
                }
    
                @Override
                public boolean onScroll(MotionEvent e1, MotionEvent e2,
                        float distanceX, float distanceY) {
                    // TODO Auto-generated method stub
                    return false;
                }
    
                @Override
                public void onShowPress(MotionEvent e) {
                    // TODO Auto-generated method stub
    
                }
    
                @Override
                public boolean onSingleTapUp(MotionEvent e) {
                    // TODO Auto-generated method stub
                    return false;
                }
    
            }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a scrollview that I had to the view of the view controller
I have defined a style for Linear layout but the layout is not visible
I have added some table and other vies in a scrollview. scrolling in tables
I' have a view that contains several textViews an ImageView and a Button .
I have a ScrolLView that wraps a ViewFlipper. The content in the ViewFlipper is
I have a GridView inside of a LinearLayout inside of a ScrollView that pages
I have a script that appends some rows to a table. One of the
i have a input tag which is non editable, but some times i need
I have custom view in a HorizontalScrollView wrapped in a ScrollView and I want
One part of my layout is supposed to have two components: A ScrollView on

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.