title: How to create .xml file from java file (Android)?
body: <p>So i have this java file which basically creates a list of menu items that will take me to that specific activity. I created the list in java but did not create an .xml file when creating the list. Normally, when creating a new activity, android creates an .xml and java file for both. I only created a java file for it. Can android auto generate an .xml file for my menu class or do i have to recreate it?</p>
  
  <p>Code:</p>
  
  <p>Menu.java</p>
  
  <pre><code>package com.AthleteProgram.x.athleteprogram;
  
  import android.app.ListActivity;
  import android.content.Intent;
  import android.os.Bundle;
  import android.view.View;
  import android.widget.ArrayAdapter;
  import android.widget.ListView;
  
  public class Menu extends ListActivity{
  
  String classes [] = {"AddAthlete", "Email"};
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
  
      ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(Menu.this, android.R.layout.simple_list_item_1, classes);
      setListAdapter(adapter);
  
  }
  
  @Override
  protected void onListItemClick(ListView l, View v, int position, long id) {
      super.onListItemClick(l, v, position, id);
  
      String listPosition = classes[position];
      try {
          Class myClass = Class.forName("com.AthleteProgram.x.athleteprogram." + listPosition);
          Intent intent = new Intent(Menu.this, myClass);
          startActivity(intent);
      } catch (ClassNotFoundException e) {
          e.printStackTrace();
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>I tried to create a menu.xml but to no avail:</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:orientation="vertical"
  android:paddingLeft="@dimen/activity_horizontal_margin"
  android:paddingRight="@dimen/activity_horizontal_margin"
  android:paddingTop="@dimen/activity_vertical_margin"
  android:paddingBottom="@dimen/activity_vertical_margin"
  tools:context="com.AthleteProgram.x.athleteprogram.Menu"&gt;
  
  &lt;TextView
      android:text="@string/hello_world"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_gravity="center"/&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>What do I do to get a visual .xml file so I can see exactly what I am working with?
  Thank you!</p>