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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:37:10+00:00 2026-06-17T18:37:10+00:00

In my XML layout, I have among other things two EditText elements and a

  • 0

In my XML layout, I have among other things two EditText elements and a few buttons. XML looks like this (most things removed, only relevant pieces left)

<RelativeLayout>

    <RelativeLayout android:id="@+id/entry_id">

        <Button
             android:id="@+id/btn_select"
             layout_alignParentRight="true" />

        <EditText
             android:id="@+id/txt_id"
             android:layout_toLeftOf="@id/btn_select"
             anddroid:nextFocusDown="@id/txt_extras" />

        <Button
             android:id="@+id/btn_quality"
             android:layout_below="txt_id" />
    </RelativeLayout>

    <EditText
        android:id="@+id/txt_extras"
        android:layout_below="@id/entry_id" />

</RelativeLayout>

This produces a layout sort of like this:

+-----------------------------------------------+
|+---------------------------------------------+|
||                                             ||
||  +----------------------+  +-------------+  ||
||  | First text field     |  | Button      |  ||
||  +----------------------+  +-------------+  ||
||                                             ||
||  +----------------+                         ||
||  | Another button |                         ||
||  +----------------+                         ||
||                                             ||
|+---------------------------------------------+|
|                                               |
| +-------------------------------------------+ |
| | Second text field                         | |
| +-------------------------------------------+ |
+-----------------------------------------------+

Note that this is not the entire layout, there are a lot more different views in it, but I’m only concerned with these ones. The reason RelativeLayouts are used is because they actually make it possible to lay out views in the way that the client wants.

Now, I need to define the block with the first text and buttons before defining the second text so that I could specify that the second text is below that block. However then I get an error in the first text field because I’m referring to the second text field in the nextFocusDown attribute, because the second text field is not defined yet. This becomes catch 22. Is there any way to make eclipse/lint/whatever understand that the field it’s complaining about not being there is actually there, just a few lines below? That is, is it possible to make it look at the file holistically, as a whole, and not line-by-line?

Alternatively, is there any other way to specify that I want the focus to go to the second text field and not to the second button when “next” is pressed on the soft keyboard?

  • 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-17T18:37:11+00:00Added an answer on June 17, 2026 at 6:37 pm
    anddroid:nextFocusDown="@id/txt_extras"
    

    The above line should be changed to:

    android:nextFocusDown="@+id/txt_extras"
    

    As you can see in the input events documentation, they use @+id for nextFocus*, even if the ID is already defined.

    If you still get an error, you may have to change android:id="@+id/txt_extras" to android:id="@id/txt_extras" (removing the + sign), but this shouldn’t be necessary.

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

Sidebar

Related Questions

I have two buttons in my xml layout as shown bellow. I used an
I have an XML layout similar to this (the XML and code is a
I have an xml layout for a Fragment (android.support.v4.app.Fragment). When this Fragment is added
I have 3 main elements in my XML layout (also see the image): The
I have this code in a xml layout file: <reference name=left> <block type=blog/blog name=left.blog.menu
I want to expand my XML layout as I have a number of buttons
I have a complex layout situation in which an horizontal LinearLayout holds two other
I have an XML layout that defines a TextView box 50px x 320px who
I have an XML layout and want to add my own custom SurfaceView to
I have the following XML layout for a ListActivity. <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android

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.