java.lang.IllegalStateException: ScrollView can host only one direct child

Stack Overflow | Patrick Porter | 8 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Tried adding ScrollView to my layout, but it crashes my app

    Stack Overflow | 8 months ago | Patrick Porter
    java.lang.IllegalStateException: ScrollView can host only one direct child
  2. 0

    App Crashes on Launch [Android]

    Stack Overflow | 1 year ago | Blank
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.dgriffin.relativelayotuandscrollview/com.dgriffin.relativelayotuandscrollview.MainActivity}: java.lang.IllegalStateException: ScrollView can host only one direct child
  3. 0

    ScrollView can host only one direct child but it has only one

    Stack Overflow | 9 months ago | Alex Ferg
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example/com.example.activity.EditProjectActivity}: java.lang.IllegalStateException: ScrollView can host only one direct child
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Application crashes when SetContentView set back to main activity (Not answered)

    Stack Overflow | 2 months ago | TerZer
    java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
  6. 0

    Android Admob force closin

    Stack Overflow | 4 years ago | mr.j05hua
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mrj05hua.hanselgretelwhfree/com.mrj05hua.hanselgretelwhfree.MainActivity}: java.lang.IllegalStateException: ScrollView can host only one direct child
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.IllegalStateException

    ScrollView can host only one direct child

    at android.widget.ScrollView.addView()
  2. Android Platform
    LayoutInflater.inflate
    1. android.widget.ScrollView.addView(ScrollView.java:410)
    2. android.view.LayoutInflater.rInflate(LayoutInflater.java:770)
    3. android.view.LayoutInflater.inflate(LayoutInflater.java:498)
    4. android.view.LayoutInflater.inflate(LayoutInflater.java:398)
    5. android.view.LayoutInflater.inflate(LayoutInflater.java:354)
    5 frames
  3. Android v7
    AppCompatActivity.setContentView
    1. android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:284)
    2. android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
    2 frames
  4. com.example.android
    MainActivity.onCreate
    1. com.example.android.justjava.MainActivity.onCreate(MainActivity.java:23)
    1 frame
  5. Android Platform
    ActivityThread.performLaunchActivity
    1. android.app.Activity.performCreate(Activity.java:5585)
    2. android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1093)
    3. android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2400)
    3 frames