Textview not resizing after dynamically adding text?
<p>Here is my XML. I'm adding the text dynamically and setting it as wrap_content in the XML, but afterwards the textview does not seem to be resizing based on the contained text. I'm using an expandable layout to expand on click from <a href="https://github.com/AAkira/ExpandableLayout" rel="nofollow">https://github.com/AAkira/ExpandableLayout</a>.
I'm assuming one of the parent heights have been set wrong, but I've check pretty much all combinations and nothing seems to be helping. Setting the height as hardcoded (500dp) works perfectly fine. Can anyone help me out? Thanks!</p>



<pre><code>&lt;android.support.design.widget.CoordinatorLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:card_view="http://schemas.android.com/tools"&gt;

    &lt;ScrollView
        android:layout_height="match_parent"
        android:layout_width="wrap_content"
        android:fillViewport="true"&gt;

        &lt;LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical"&gt;

            &lt;android.support.v7.widget.CardView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:id="@+id/cardviewTwitterMessages"
                android:layout_marginBottom="8dp"
                card_view:cardElevation="4dp"
                card_view:cardUseCompatPadding="true"
                card_view:cardCornerRadius="5dp"&gt;

                &lt;RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"&gt;

                    &lt;Button
                        android:id="@+id/expandableButton1"
                        android:layout_width="fill_parent"
                        android:layout_height="wrap_content"
                        android:background="@color/colorPrimary"
                        android:drawableLeft="@android:drawable/arrow_down_float"
                        android:onClick="expandableButton1"
                        android:paddingRight="10dp"
                        android:text="Recent Tweets"
                        android:textColor="#fff" /&gt;

                    &lt;com.github.aakira.expandablelayout.ExpandableRelativeLayout
                        android:id="@+id/expandableLayout1"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_below="@+id/expandableButton1"
                        android:background="#fff"
                        android:padding="16dp"
                        app:ael_duration="400"
                        app:ael_expanded="false"
                        app:ael_interpolator="bounce"
                        app:ael_orientation="vertical"&gt;

                        &lt;TextView
                            android:textColorLink="@color/colorPrimary"
                            android:id="@+id/TwitterMessagesText"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:minLines="50"/&gt;
                    &lt;/com.github.aakira.expandablelayout.ExpandableRelativeLayout&gt;
                &lt;/RelativeLayout&gt;
            &lt;/android.support.v7.widget.CardView&gt;
        &lt;/LinearLayout&gt;

    &lt;/ScrollView&gt;

    &lt;android.support.design.widget.FloatingActionButton
        android:id="@+id/fab2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom|end"
        android:layout_margin="@dimen/fab_margin"
        android:src="@android:drawable/ic_input_add"
        android:tint="#fdfdfd" /&gt;

&lt;/android.support.design.widget.CoordinatorLayout&gt;
</code></pre>