Trouble with ImageView gravity on Java, Android
<p>I have this code: </p>

<pre><code>&lt;LinearLayout 
    android:layout_weight="0.5" 
    android:layout_width="0px" 
    android:id="@+id/linearLayout2" 
    android:orientation="vertical" 
    android:layout_height="fill_parent"&gt;
&lt;LinearLayout 
    android:layout_weight="0.45" 
    android:layout_width="fill_parent" 
    android:id="@+id/linearLayoutMainLogo" 
    android:orientation="horizontal"
    android:gravity="center" 
    android:layout_height="0px"&gt;
    &lt;ImageView 
        android:src="@drawable/logo" 
        android:layout_gravity="center"
        android:layout_width="wrap_content" 
        android:id="@+id/imageViewLogo" 
        android:layout_height="wrap_content" /&gt;
&lt;/LinearLayout&gt;
&lt;/LinearLayout&gt;
</code></pre>

<p>I need to set ImageView in center of LinearLayout by horizontal and by vertical simultaneously, but my code doesn't work. Where did I do mistake? Thank you</p>
