title: set text of ListView in center - android
body: <p>I try to set text of ListView in <strong>center</strong> of layout. I use LinearLayout and set <em>gravity = center</em>, but it always shows in <strong>left</strong></p>
  
  <p>Here is layout:</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="fill_parent" android:layout_height="fill_parent"&gt;
      &lt;LinearLayout android:orientation="vertical"
          android:layout_width="fill_parent" android:layout_height="wrap_content"
          android:gravity="center"&gt;
          &lt;ListView android:id="@+id/lv_function" android:layout_width="wrap_content"
              android:layout_height="wrap_content" android:gravity="center" /&gt;
      &lt;/LinearLayout&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>In my code, I use:</p>
  
  <pre><code>String[] functions = { "Login", "Register", "Setting", "About", "Exit" };
  lvMenu = (ListView) findViewById(R.id.lv_function);
  ArrayAdapter&lt;String&gt; arr = new ArrayAdapter&lt;String&gt;(this,
                  android.R.layout.simple_list_item_1, functions);
  // set adapter for ListView.
  lvMenu.setAdapter(arr);
  </code></pre>
  
  <p>Here is result:
  <a href="http://i596.photobucket.com/albums/tt44/shinkt/Capture.jpg" rel="nofollow">result</a></p>
  
  <p>Do you have any idea? Please help me, thanks!</p>