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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T21:03:01+00:00 2026-05-16T21:03:01+00:00

I am using ScrollView in my Android Layout but it shows IllegalStateException Scrollview can

  • 0

I am using ScrollView in my Android Layout but it shows

IllegalStateException "Scrollview can host only one direct child"

How can I avoid this exception?

Crash info:

07-19 15:58:22.308 21372 21372 D AndroidRuntime: Shutting down VM
07-19 15:58:22.313 21372 21372 E AndroidRuntime: FATAL EXCEPTION: main
07-19 15:58:22.313 21372 21372 E AndroidRuntime: Process: com.languoguang.helloworld, PID: 21372
07-19 15:58:22.313 21372 21372 E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.languoguang.helloworld/com.languoguang.helloworld.plugin_homeadd.activity.AddDeviceWifiSettingActivity}: android.view.InflateException: Binary XML file line #254: ScrollView can host only one direct child
07-19 15:58:22.313 21372 21372 E AndroidRuntime:        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3190)
07-19 15:58:22.313 21372 21372 E AndroidRuntime:        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3285)
07-19 15:58:22.313 21372 21372 E AndroidRuntime:        at android.app.ActivityThread.-wrap12(Unknown Source:0)
07-19 15:58:22.313 21372 21372 E AndroidRuntime:        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1887)
07-19 15:58:22.313 21372 21372 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:108)
07-19 15:58:22.313 21372 21372 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:166)
07-19 15:58:22.313 21372 21372 E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:7412)
07-19 15:58:22.313 21372 21372 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)
07-19 15:58:22.313 21372 21372 E AndroidRuntime:        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
07-19 15:58:22.313 21372 21372 E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:926)
07-19 15:58:22.313 21372 21372 E AndroidRuntime: Caused by: android.view.InflateException: Binary XML file line #254: ScrollView can host only one direct child
07-19 15:58:22.313 21372 21372 E AndroidRuntime: Caused by: java.lang.IllegalStateException: ScrollView can host only one direct child
07-19 15:58:22.313 21372 21372 E AndroidRuntime:        at android.widget.ScrollView.addView(ScrollView.java:292)
07-19 15:58:22.313 21372 21372 E AndroidRuntime:        at android.view.LayoutInflater.rInflate(LayoutInflater.java:878)
07-19 15:58:22.313 21372 21372 E AndroidRuntime:        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:835)
07-19 15:58:22.313 21372 21372 E AndroidRuntime:        at android.view.LayoutInflater.rInflate(LayoutInflater.java:877)
07-19 15:58:22.313 21372 21372 E AndroidRuntime:        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:835)
07-19 15:58:22.313 21372 21372 E AndroidRuntime:        at android.view.LayoutInflater.rInflate(LayoutInflater.java:877)
07-19 15:58:22.313 21372 21372 E AndroidRuntime:        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:835)
07-19 15:58:22.313 21372 21372 E AndroidRuntime:        at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
07-19 15:58:22.313 21372 21372 E AndroidRuntime:        at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
07-19 15:58:22.313 21372 21372 E AndroidRuntime:        at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
07-19 15:58:22.313 21372 21372 E AndroidRuntime:        at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:477)
07-19 15:58:22.313 21372 21372 E AndroidRuntime:        at com.android.internal.policy.HwPhoneWindow.setContentView(HwPhoneWindow.java:313)
07-19 15:58:22.313 21372 21372 E AndroidRuntime:        at android.app.Activity.setContentView(Activity.java:2843)
07-19 15:58:22.313 21372 21372 E AndroidRuntime:        at com.languoguang.helloworld.plugin_homeadd.activity.AddDeviceWifiSettingActivity.onCreate(AddDeviceWifiSettingActivity.java:82)
07-19 15:58:22.313 21372 21372 E AndroidRuntime:        at android.app.Activity.performCreate(Activity.java:7358)
07-19 15:58:22.313 21372 21372 E AndroidRuntime:        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1218)
07-19 15:58:22.313 21372 21372 E AndroidRuntime:        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3143)
07-19 15:58:22.313 21372 21372 E AndroidRuntime:        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3285)
07-19 15:58:22.313 21372 21372 E AndroidRuntime:        at android.app.ActivityThread.-wrap12(Unknown Source:0)
07-19 15:58:22.313 21372 21372 E AndroidRuntime:        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1887)
07-19 15:58:22.313 21372 21372 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:108)
07-19 15:58:22.313 21372 21372 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:166)
07-19 15:58:22.313 21372 21372 E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:7412)
07-19 15:58:22.313 21372 21372 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)
07-19 15:58:22.313 21372 21372 E AndroidRuntime:        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
07-19 15:58:22.313 21372 21372 E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:926)
  • 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-16T21:03:02+00:00Added an answer on May 16, 2026 at 9:03 pm

    You have added more than one controls as children of a ScrollView. If you want to do this add a LinearLayout as a direct child and put the other controls in it.

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

Sidebar

Related Questions

In my android application i am using a table inside a scrollview but am
My scenario is like this: <ScrollView android:layout_width=fill_parent android:layout_height=fill_parent android:scrollbars=vertical android:background=#ffffeb> <LinearLayout android:orientation=vertical android:layout_width=fill_parent android:layout_height=fill_parent
In my android appl;ication I am using a table inside a scrollview and below
In my android application i am using a table with scrollview.I am giving the
Using PyObjC , you can use Python to write Cocoa applications for OS X.
Using VS2008, C#, .Net 2 and Winforms how can I make a regular Button
I am following the Android Gallery tutorial ( http://developer.android.com/guide/tutorials/views/hello-gallery.html ) but instead of simple
I have an android activity in which I'm using tabs. public class UnitActivity extends
I am trying out this table layout in which there are three columns, each
I am writing for Android, and I can't figure out how to replicate the

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.