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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T20:11:12+00:00 2026-06-11T20:11:12+00:00

I have to different EditText like these : EditText1 has the inputType textCapWords EditText2

  • 0

I have to different EditText like these :

enter image description here

  • EditText1 has the inputType “textCapWords”
  • EditText2 has the inputType “number”

When I launch my activity, I instantly request focus on the EditText1. The only way to do so that is working is to add this on the onCreate :

getWindow().setSoftInputMode(
WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
EDITTEXT1.requestFocus();

When the user clicks on “Return” on his soft Keyboard, I want the EDITTEXT2 to obtain focus. So I added this :

EDITTEXT1.setOnKeyListener(new OnKeyListener() {
    public boolean onKey(View v, int keyCode, KeyEvent event) {
        if (keyCode == 66) { // CODE FOR RETURN
            EDITTEXT2.requestFocus();
        }
        return false;
    }
});

But when I do so, nothing happens. All my EditText are set FocusableInTouchMode and Focusable :

<EditText
    android:id="@+id/EDITTEXT1"
    android:layout_width="0dip"
    android:layout_height="20dip"
    android:layout_weight="2"
    android:background="@color/White"
    android:ems="10"
    android:hint="My First EditText"
    android:inputType="textCapWords"
    android:padding="2dip"
    android:singleLine="true"
    android:textColor="@color/Black"
    android:textSize="12dip" >
    <requestFocus />
</EditText>

<EditText
    android:id="@+id/EDITTEXT2"
    android:layout_width="0dip"
    android:layout_height="20dip"
    android:layout_weight="2"
    android:background="@color/White"
    android:ems="10"
    android:hint="My Second EditText"
    android:inputType="textCapWords"
    android:padding="2dip"
    android:singleLine="true"
    android:textColor="@color/Black"
    android:textSize="12dip" >
</EditText>

Do you have any idea on how I could focus the EDITTEXT2 after pressing OK on EDITTEXT1 ?

Thanks in advance!

  • 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-11T20:11:13+00:00Added an answer on June 11, 2026 at 8:11 pm

    Thanks a lot for your answer. I finally found the easiest way to answer my own question :

    Add :

    android:nextFocusRight=”@+id/EDITTEXT2″

    To the properties of EDITTEXT1.

    Nothing else is needed in order to go to the EDITTEXT2 after clicking “Enter” on EDITTEXT1.

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

Sidebar

Related Questions

I have Four EditText with different background. It looks like this: I want to
I have an application in which I have different activities. In 1 activity, I
I have different elements in my layout: Buttons, RadioButtons, EditText, a ListView and I
I have this EditText field inside of one activity, and I want it so
I have a unknown number of TextView elements some EditText elements and so on,
I have an application that has multiple releases for different clients. For each client
I have an EditText with android:inputType=phone keybord. There is an OK on this keyboard.
I have different Bundles: MainBundle (Homepage), SecurityBundle (Login, Registration), MessageBundle (Message System), ShopBundle. I
I have different values in different classes. I need to insert them in the
I have different blocks of 34 threads each (0...33). I need to find a

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.