title: android requestWindowFeature(Window.FEATURE_PROGRESS) ERROR
body: <p>I am trying to put a progress status on my windows view but it is causing me error each time I run my app</p>
  
  <pre><code>package example.asynctaskdemo;
  
  import android.os.AsyncTask;
  import android.os.Bundle;
  import android.support.v7.app.ActionBarActivity;
  import android.view.Menu;
  import android.view.MenuItem;
  import android.view.Window;
  import android.widget.ArrayAdapter;
  import android.widget.ListView;
  
  import java.util.ArrayList;
  
  
  public class asynctaskdemo extends ActionBarActivity {
      private ListView mainList;
  
      private String[] texts = {"1", "2", "3", "4", "5", "6", "7", "8", "9", "10",
      "11", "12", "13", "14"};
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          requestWindowFeature(Window.FEATURE_PROGRESS);
          setContentView(R.layout.activity_asynctaskdemo);
          mainList = (ListView)findViewById(R.id.my_list);
          mainList.setAdapter(new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1, new ArrayList&lt;String&gt;()));
  
          new myAsync().execute();
      }
  
      class myAsync extends AsyncTask&lt;Void, String, Void&gt;{
          private ArrayAdapter&lt;String&gt; adapter;
          private int counter = 0;
          @Override
          protected void onPreExecute() {
              adapter = (ArrayAdapter&lt;String&gt;)mainList.getAdapter();
              setProgressBarIndeterminate(false);
              setProgressBarVisibility(true);
          }
  
          @Override
          protected Void doInBackground(Void... params) {
  
              for(String item: texts){
                  publishProgress(item);
                  try {
                      Thread.sleep(2000);
                  } catch (InterruptedException e) {
                      e.printStackTrace();
                  }
              }
              return null;
          }
  
          @Override
          protected void onProgressUpdate(String... values) {
              adapter.add(values[0]);
              counter++;
              setProgress((int)(((double)counter/texts.length)*10000));
          }
  
          @Override
          protected void onPostExecute(Void aVoid) {
              setProgressBarVisibility(false);
              Debug_It.s(asynctaskdemo.this, "Task has run successfully");
          }
      }
  
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          // Inflate the menu; this adds items to the action bar if it is present.
          getMenuInflater().inflate(R.menu.menu_asynctaskdemo, menu);
          return true;
      }
  
      @Override
      public boolean onOptionsItemSelected(MenuItem item) {
          // Handle action bar item clicks here. The action bar will
          // automatically handle clicks on the Home/Up button, so long
          // as you specify a parent activity in AndroidManifest.xml.
          int id = item.getItemId();
  
          //noinspection SimplifiableIfStatement
          if (id == R.id.action_settings) {
              return true;
          }
  
          return super.onOptionsItemSelected(item);
      }
  }
  </code></pre>
  
  <p>ERROR:</p>
  
  <pre><code>03-31 19:34:18.960    1058-1058/example.asynctaskdemo E/AndroidRuntime﹕ FATAL EXCEPTION: main
      Process: example.asynctaskdemo, PID: 1058
      java.lang.RuntimeException: Unable to start activity ComponentInfo{example.asynctaskdemo/example.asynctaskdemo.asynctaskdemo}: android.util.AndroidRuntimeException: requestFeature() must be called before adding content
              at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
              at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245) 
  </code></pre>
  
  <p>The compiler is also suggesting me to use <code>supportRequestWindowFeature();</code> SO I need help with this error and I also would like to know what is the difference between <code>supportRequestWindowFeature()</code> and <code>requestWindowFeature();</code></p>