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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:33:27+00:00 2026-06-02T16:33:27+00:00

i have in my android main.xml file as the following.. when i run it

  • 0

i have in my android main.xml file as the following..
when i run it is showing some exception but in main.xml in graphical view it is not showing any error..
follwing is my code inside Linearlayout

      <ScrollView android:id="@+id/ScrollView01" 
        android:layout_width="fill_parent" 
        android:layout_height="match_parent">

          <LinearLayout
            android:orientation="vertical"
            android:layout_width="fill_parent"
            android:layout_gravity="top"
            android:layout_height="match_parent">       

              <TextView android:layout_width="fill_parent"
                       android:layout_height="wrap_content"
                       android:layout_gravity="center"
                       android:text="UserName"/>

               <EditText android:id="@+id/username"
                       android:layout_width="fill_parent"
                       android:layout_height="wrap_content"
                       android:text=""/>                              
           <Button
               android:id="@+id/login_button"
               android:layout_width="60dp"
               android:layout_height="30dp"
               android:text="login"/>
        </LinearLayout>

         <LinearLayout
            android:orientation="vertical"
            android:layout_width="fill_parent"
            android:layout_gravity="top"
            android:layout_height="match_parent">       

              <TextView android:layout_width="fill_parent"
                       android:layout_height="wrap_content"
                       android:layout_gravity="center"
                       android:text=""/>

               <EditText android:layout_width="fill_parent"
                       android:layout_height="wrap_content"
                       android:text=""/>                              
           <Button
               android:layout_width="60dp"
               android:layout_height="30dp"
               android:text="@string/login_btn"/>
        </LinearLayout>
    </ScrollView>
  • 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-02T16:33:28+00:00Added an answer on June 2, 2026 at 4:33 pm

    ScrollView should have ONLY ONE child. in ur example u have placed 2 linear layouts inside scrollview which is causing error..
    place the 2 linear layouts inside 1 linear layout and place the whole thing in scrollview. it will work..

        <ScrollView android:id="@+id/ScrollView01" 
            android:layout_width="fill_parent" 
            android:layout_height="match_parent">
                 <LinearLayout
                android:orientation="vertical"
                android:layout_width="fill_parent"
                android:layout_gravity="top"
                android:layout_height="match_parent">  
                          <LinearLayout
                            android:orientation="vertical"
                            android:layout_width="fill_parent"
                            android:layout_gravity="top"
                            android:layout_height="match_parent">       
    
                              <TextView android:layout_width="fill_parent"
                                       android:layout_height="wrap_content"
                                       android:layout_gravity="center"
                                       android:text="@string/UserNameText"/>
    
                               <EditText
                                       android:id="@+id/username"
                                       android:layout_width="fill_parent"
                                       android:layout_height="wrap_content"
                                       android:text="@string/UserNameText"/>                              
                           <Button
                               android:id="@+id/login_button"
                               android:layout_width="60dp"
                               android:layout_height="30dp"
                               android:text="@string/login_btn"/>
                        </LinearLayout>
    
                         <LinearLayout
                            android:orientation="vertical"
                            android:layout_width="fill_parent"
                            android:layout_gravity="top"
                            android:layout_height="match_parent">       
    
                              <TextView android:layout_width="fill_parent"
                                       android:layout_height="wrap_content"
                                       android:layout_gravity="center"
                                       android:text="@string/UserNameText"/>
    
                               <EditText
                                       android:id="@+id/username"
                                       android:layout_width="fill_parent"
                                       android:layout_height="wrap_content"
                                       android:text="@string/UserNameText"/>                              
                           <Button
                               android:id="@+id/login_button"
                               android:layout_width="60dp"
                               android:layout_height="30dp"
                               android:text="@string/login_btn"/>
                        </LinearLayout>
            </LinearLayout>
        </ScrollView>
    

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

Sidebar

Related Questions

I have the following main.xml file with a LinearLayout <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android
i am new to android.i have one single activity with main.xml file. Now, i
I have the following the layout file <?xml version=1.0 encoding=utf-8?> <RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android xmlns:app=http://schemas.android.com/apk/res/com.company android:layout_width=fill_parent
I have this main.xml file: <?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 android:background=@drawable/background
I have the following AndroidManifest file... <?xml version=1.0 encoding=utf-8?> <manifest xmlns:android=http://schemas.android.com/apk/res/android package=net.obviam.droidz android:versionCode=1 android:versionName=1.0
I have an Android app with a ListActivity in the main view. The list
I have android.permission.READ_OWNER_DATA but I can't find any reliable code that would explain how
I have the following layout in XML (splashscreen.xml): <?xml version=1.0 encoding=utf-8?> <FrameLayout xmlns:android=http://schemas.android.com/apk/res/android android:id=@+id/frmLayout
In my app I have the main activity defined in the manifest.xml file like
I am making a custom titlebar using the following xml file: <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:id=@+id/myTitle

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.