Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>what do you want do achiev? this is what you actually doing:</p> <pre><code>setContentView(R.layout.game_board); </code></pre> <p>->game_board is inflatet with both childs layoutTopicGrade and layoutGames</p> <pre><code>topicGrade = (LinearLayout)findViewById(R.id.layoutTopicGrade); </code></pre> <p>->this is a instance of layoutTopicGrade</p> <pre><code>scroll = new ScrollView(this); </code></pre> <p>->you create a scroll view</p> <pre><code>scroll.addView(topicGrade); </code></pre> <p>->you add topicGrade to the scroll view</p> <p><strong>This failed, because topicGrade already has a parent (layoutFilterContent)</strong> </p> <pre><code>this.setContentView(scroll); </code></pre> <p>->you set the croll view as content.<br> (why did you set R.layout.game_board as content before?)</p> <p>if you only want topicGrade in a <code>ScrollView</code> as <code>ContentView</code>, why didn't you create a xml with this structure?</p> <p>if it is recommended to do it like you do, the solution is: </p> <pre><code>topicGrade = (LinearLayout)findViewById(R.id.layoutTopicGrade); ((LinearLayout)topicGrade.getParent()).removeView(topicGrade) </code></pre> <p>but i can't see why you should do it in this way ^^</p> <p>--edit: now i've got it, here is the you need:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal" android:weightSum="4" &gt; &lt;ScrollView android:id="@+id/scrollView1" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_weight="1"&gt; &lt;LinearLayout android:id="@+id/vertical_container" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" &gt; &lt;/LinearLayout&gt; &lt;/ScrollView&gt; &lt;HorizontalScrollView android:id="@+id/horizontalScrollView1" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_weight="3"&gt; &lt;LinearLayout android:id="@+id/horizontal_container" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal" &gt; &lt;/LinearLayout&gt; &lt;/HorizontalScrollView&gt; &lt;/LinearLayout&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload