Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy dont my linear layout view gets displayed when i run my app
    text
    copied!<p>i have already created my xml file in which 4 layouts are used. now i want a linear layout to be displayed between my 3rd and fourth layout.i have set the width of this new layout to 0dp, for which i want the width to be changed to "wrap content" when my app is launched. </p> <p>i have tried using the following code</p> <pre><code>LinearLayout layout = (LinearLayout)base.findViewById(R.id.layout); LinearLayout.LayoutParams params = new LinearLayout.LayoutParams( LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT); Log.w(TAG, "layout " +layout); layout.setLayoutParams(params); </code></pre> <p>following is my layout in xml file</p> <pre><code> &lt;LinearLayout android:layout_width="fill_parent" android:id="@+id/layout" android:layout_marginLeft="5dp" android:layout_marginRight="5dp" android:layout_height="0dp" &gt; &lt;Button android:id="@+id/button1" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_width="wrap_content" android:text="NO" android:layout_marginLeft="50dp" android:layout_marginTop="64dp"&gt;&lt;/Button&gt; &lt;Button android:id="@+id/button2" android:layout_alignParentRight="true" android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="YES" android:layout_marginRight="50dp" android:layout_marginTop="64dp"&gt;&lt;/Button&gt; &lt;/LinearLayout&gt; </code></pre> <p>but the layout value takes here as null.. Can anyone tell me how this can be solved..??? Thanks in advance..</p>
 

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