title: Show ListView on MainActivity
body: <p>I have the method <code>show_list</code> that creates a <code>List</code> from some strings, after adds the <code>List</code> to <code>ArrayAdapter</code> and binds the adapter to <code>ListView</code>. Returns the <code>ListView</code> created. How can I add the <code>ListView</code> to <code>MainActivity</code> and show it?</p>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
      }
  
      private View show_list() {
          String[] data = {"Ionut","Eugeniu","George","Felix","Fazlidin"};
          List&lt;String&gt; data_list = new ArrayList&lt;&gt;(Arrays.asList(data));
          ArrayAdapter&lt;String&gt; data_adapter = new ArrayAdapter&lt;&gt;(this,R.layout.list_item,data_list);
          ListView data_view = (ListView)this.findViewById(R.id.list_view);
          data_view.setAdapter(data_adapter);
          return data_view;
      }
  }
  </code></pre>
  
  <p>activity_main.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:id="@+id/activity_main"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      tools:context="com.example.ionut.vremea2.MainActivity"&gt;
  
      &lt;ListView
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:id="@+id/list_view" /&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>list_item.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  
  &lt;TextView xmlns:android="http://schemas.android.com/apk/res/android"
      android:text="Ionut"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:id="@+id/list_item" /&gt;
  </code></pre>