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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T23:18:00+00:00 2026-06-09T23:18:00+00:00

The xml below shows my layout. If you view this layout in the graphical

  • 0

The xml below shows my layout. If you view this layout in the graphical editor the “Tempo” EditText is blue. That makes this field the item that has focus when the activity is open. I would like to have the “Name” field the first field that has focus when the Activity starts. Any ideas? Thanks.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/content_panel"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="#fffafafa"
    android:orientation="vertical" >

    <ScrollView
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/scroll_view"
        android:layout_width="fill_parent"
        android:layout_height="0dip"
        android:layout_weight="1.0"
        android:fadingEdge="none" >

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:paddingLeft="10.0dip"
            android:paddingRight="10.0dip"
            android:paddingTop="10.0dip"
            android:focusableInTouchMode="true" >

            <LinearLayout
                android:id="@+id/songname_layout"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical" >

                <TextView
                    style="?android:attr/textAppearanceSmall"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:text="@string/songname"
                    android:textColor="#ff000000"
                    android:textStyle="bold" />

                <EditText
                    android:id="@+id/edit_songname"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:imeOptions="actionNext"
                    android:inputType="textCapSentences"
                    android:textColor="#ff000000" >

                </EditText>
            </LinearLayout>

            <LinearLayout
                android:id="@+id/artist_layout"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical" >

                <TextView
                    style="?android:attr/textAppearanceSmall"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:text="@string/artist"
                    android:textColor="#ff000000"
                    android:textStyle="bold" />

                <AutoCompleteTextView
                    android:id="@+id/autocomplete_artist"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:imeOptions="actionNext"
                    android:inputType="textCapSentences"
                    android:textColor="#ff000000" />
            </LinearLayout>

            <LinearLayout
                android:id="@+id/genre_area"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical" >

                <TextView
                    style="?android:attr/textAppearanceSmall"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:text="@string/genre"
                    android:textColor="#ff000000"
                    android:textStyle="bold" />

                <AutoCompleteTextView
                    android:id="@+id/autocomplete_genre"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:imeOptions="actionNext"
                    android:inputType="textCapSentences"
                    android:textColor="#ff000000" />
            </LinearLayout>

            <LinearLayout
                android:id="@+id/notes_area"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical" >

                <TextView
                    style="?android:attr/textAppearanceSmall"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:text="@string/notes"
                    android:textColor="#ff000000"
                    android:textStyle="bold" />

                <EditText
                    android:id="@+id/notes"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:capitalize="sentences"
                    android:gravity="top"
                    android:imeOptions="actionNext"
                    android:inputType="textCapSentences"
                    android:minLines="3"
                    android:textColor="#ff000000" />
            </LinearLayout>

            <LinearLayout
                android:id="@+id/song_length_area"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical" >

                <TextView
                    style="?android:attr/textAppearanceSmall"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:text="@string/song_length"
                    android:textColor="#ff000000"
                    android:textStyle="bold" />

                <LinearLayout
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal" >

                    <EditText
                        android:id="@+id/edit_minute"
                        android:layout_width="60dp"
                        android:layout_height="wrap_content"
                        android:gravity="right"
                        android:imeOptions="actionNext"
                        android:inputType="number"
                        android:maxLength="3"
                        android:textColor="#ff000000" />

                    <TextView
                        style="?android:attr/textAppearanceSmall"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/semicolon"
                        android:textColor="#ff000000"
                        android:textStyle="bold" />

                    <EditText
                        android:id="@+id/edit_second"
                        android:layout_width="40dp"
                        android:layout_height="wrap_content"
                        android:gravity="right"
                        android:imeOptions="actionNext"
                        android:inputType="number"
                        android:maxLength="2"
                        android:textColor="#ff000000" />

                    <TextView
                        style="?android:attr/textAppearanceSmall"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/minsec"
                        android:textColor="#ff000000"
                        android:textStyle="bold" />
                </LinearLayout>
            </LinearLayout>

            <LinearLayout
                android:id="@+id/tempo_area"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical" >

                <TextView
                    style="?android:attr/textAppearanceSmall"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:text="@string/tempo"
                    android:textColor="#ff000000"
                    android:textStyle="bold" />

                <EditText
                    android:id="@+id/edit_tempo"
                    android:layout_width="60dp"
                    android:layout_height="wrap_content"
                    android:gravity="right"
                    android:imeOptions="actionNext"
                    android:inputType="number"
                    android:maxLength="3"
                    android:textColor="#ff000000" >

                    <requestFocus />
                </EditText>
            </LinearLayout>

            <LinearLayout
                android:id="@+id/key_area"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical" >

                <TextView
                    style="?android:attr/textAppearanceSmall"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:text="@string/key"
                    android:textColor="#ff000000"
                    android:textStyle="bold" />

                <Spinner
                    android:id="@+id/edit_key"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:imeOptions="actionNext"
                    android:textColor="#ff000000" />
            </LinearLayout>

            <LinearLayout
                android:id="@+id/depreciated_area"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal" >

                <CheckBox
                    android:id="@+id/depreciated"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/depreciated"
                    android:textColor="#ff000000"
                    android:textStyle="bold" />
            </LinearLayout>
        </LinearLayout>
    </ScrollView>

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:paddingBottom="1.0dip"
        android:paddingLeft="4.0dip"
        android:paddingRight="4.0dip"
        android:paddingTop="5.0dip" >

        <Button
            android:id="@+id/btnsave"
            android:layout_width="0.0dip"
            android:layout_height="fill_parent"
            android:layout_weight="1.0"
            android:text="@string/save" />

        <Button
            android:id="@+id/btncancel"
            android:layout_width="0.0dip"
            android:layout_height="fill_parent"
            android:layout_weight="1.0"
            android:text="@string/cancel" />
    </LinearLayout>

</LinearLayout>
  • 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-09T23:18:00+00:00Added an answer on June 9, 2026 at 11:18 pm

    Use requestFocus to bring focus to a specific EditText:

                <EditText
                    android:id="@+id/edit_songname"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:imeOptions="actionNext"
                    android:inputType="textCapSentences"
                    android:textColor="#ff000000" >
    
                    <requestFocus />
    
                </EditText>
    

    As you can see in your layout, the tempo field is the one that has requestFocus in it. Just move it to your songname field, and all will be well.

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

Sidebar

Related Questions

I setup a logging.xml file as shown below. This file includes output to the
My main.xml layout simply contains a button and a LinearLayout content_area , which shows
Right now I have this layout: <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:orientation=vertical android:layout_width=fill_parent android:layout_height=fill_parent
Hey I want to make a view appear below the last that has been
This is my first time trying to use a custom view in XML and
My XMl Layout is as like below: <RelativeLayout android:id=@+id/dateSelectionLayout android:layout_width=fill_parent android:layout_height=wrap_content android:orientation=vertical android:visibility=visible> <EditText
I have 1 ListView and 2 buttons in layout.xml file as shown below: <ListView
I have two buttons in my xml layout as shown bellow. I used an
i have an xml file sitemap.xml as shown below ..i need to add one
I using a dataset to read an xml file as shown below DataSet ds

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.