java.lang.IllegalStateException

ScrollView can host only one direct child

Solutions on the web3384

  • ScrollView can host only one direct child
  • ScrollView can host only one direct child
  • via Stack Overflow by user7796820
    , 1 month ago
    ScrollView can host only one direct child
  • Stack trace

    • java.lang.IllegalStateException: ScrollView can host only one direct child at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2436) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2495) at android.app.ActivityThread.access$900(ActivityThread.java:170) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1304) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:146) at android.app.ActivityThread.main(ActivityThread.java:5635) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.IllegalStateException: ScrollView can host only one direct child at android.widget.ScrollView.addView(ScrollView.java:410) at android.view.LayoutInflater.rInflate(LayoutInflater.java:770) at android.view.LayoutInflater.inflate(LayoutInflater.java:498) at android.view.LayoutInflater.inflate(LayoutInflater.java:398) at android.view.LayoutInflater.inflate(LayoutInflater.java:354) at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:284) at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140) at com.example.android.justjava.MainActivity.onCreate(MainActivity.java:23) at android.app.Activity.performCreate(Activity.java:5585) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1093) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2400)

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    2 times, 1 month ago
    Once, 1 month ago
    Unknown user
    Once, 8 months ago
    5 times, 1 year ago
    4 times, 1 year ago
    2 more bugmates