title: Pop up menu on Application start
body: <p>I had an application which have option to choose language at start. Currently when the application start i had to click on choose language and then pop up appears containing different languages. But I don't want to click on choose language option for displaying pop up. I want my app to automatically appears a pop up to choose language on app start. I followed 
  <a href="http://programmerguru.com/android-tutorial/android-localization-example" rel="nofollow noreferrer">this</a>
  tutorial. Here is the snapshot of the thing I would like to achieve. </p>
  
  <p><a href="http://programmerguru.com/android-tutorial/android-localization-example" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ruF2y.png" alt="enter image description here"></a></p>
  
  <p>Here is a code of Mainactivity.java</p>
  
  <pre><code>public class AndroidLocalize extends Activity {
      Spinner spinnerctrl;
      Button btn;
      Locale myLocale;
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main);
          spinnerctrl = (Spinner) findViewById(R.id.spinner1);
          spinnerctrl.setOnItemSelectedListener(new OnItemSelectedListener() {
  
              public void onItemSelected(AdapterView&lt;?&gt; parent, View view, int pos, long id) {
                  if (pos == 1) {
                      Toast.makeText(parent.getContext(), "You have selected Tamil", Toast.LENGTH_SHORT).show();
                      setLocale("ta");
                  } else if (pos == 2) {
                      Toast.makeText(parent.getContext(), "You have selected Hindi", Toast.LENGTH_SHORT).show();
                      setLocale("hi");
                  } else if (pos == 3) {
                      Toast.makeText(parent.getContext(), "You have selected English", Toast.LENGTH_SHORT).show();
                      setLocale("en");
                  }
                  else if (pos == 4) {
                      Toast.makeText(parent.getContext(), "You have selected Arabic", Toast.LENGTH_SHORT).show();
                      setLocale("ar");
                  }
              }
  
              public void onNothingSelected(AdapterView&lt;?&gt; arg0) {
                  // TODO Auto-generated method stub
              }
          });
      }
  
      public void setLocale(String lang) {
          myLocale = new Locale(lang);
          Resources res = getResources();
          DisplayMetrics dm = res.getDisplayMetrics();
          Configuration conf = res.getConfiguration();
          conf.locale = myLocale;
          res.updateConfiguration(conf, dm);
          Intent refresh = new Intent(this, AndroidLocalize.class);
          startActivity(refresh);
      }
  }
  </code></pre>
  
  <p>My main.xml</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"
      android:orientation="vertical" &gt;
  
      &lt;TextView
          android:id="@+id/greet"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:text="@string/greet"
          android:textSize="25sp" android:gravity="center" android:paddingTop="25sp" /&gt;
  
      &lt;ImageView
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:src="@drawable/sachin" android:paddingTop="25sp" /&gt;
  
      &lt;TextView
          android:textColor="#ffffff"
          android:id="@+id/textView1"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:text="@string/langselection"
          android:textAppearance="?android:attr/textAppearanceMedium" android:gravity="center" android:paddingTop="25sp"/&gt;
  
      &lt;Spinner
          android:popupBackground="#ff004372"
          android:id="@+id/spinner1"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:entries="@array/languages"
          android:gravity="center" 
          android:paddingTop="25sp" /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>