title: onCreate were called twice after implementing setRequestedOrientation
body: <p>I have a problem here where i need to display a data from a database and view it in my app in a form of table. Everything went well but since the table column is quite long(due to the data received from the database), i decided to set the orientation to landscape for easy view (i guess). After implementing this code,</p>
  
  <pre><code>setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
  </code></pre>
  
  <p>The onCreate() function got called twice. I knew it got called twice since ive included the log.i. All of my log.i got called twice.  My log should display this:</p>
  
  <pre><code>03-19 14:13:53.401: I/loop check(30510): loop
  03-19 14:13:54.112: I/jObjLength(30510): 5
  03-19 14:13:54.112: I/JSON(30510): jsonObj = work0
  03-19 14:13:54.162: I/JSON(30510): jsonObj = work1
  03-19 14:13:54.162: I/JSON(30510): jsonObj = work2
  03-19 14:13:54.172: I/JSON(30510): jsonObj = work3
  03-19 14:13:54.172: I/JSON(30510): jsonObj = work4
  </code></pre>
  
  <p>But instead, it shows this:</p>
  
  <pre><code>03-19 14:30:12.801: I/loop check(30510): loop
  03-19 14:30:12.921: I/jObjLength(30510): 5
  03-19 14:30:12.921: I/JSON(30510): jsonObj = work0
  03-19 14:30:12.931: I/JSON(30510): jsonObj = work1
  03-19 14:30:12.941: I/JSON(30510): jsonObj = work2
  03-19 14:30:12.951: I/JSON(30510): jsonObj = work3
  03-19 14:30:12.951: I/JSON(30510): jsonObj = work4
  03-19 14:30:12.981: I/loop check(30510): loop
  03-19 14:30:13.042: I/jObjLength(30510): 5
  03-19 14:30:13.042: I/JSON(30510): jsonObj = work0
  03-19 14:30:13.042: I/JSON(30510): jsonObj = work1
  03-19 14:30:13.052: I/JSON(30510): jsonObj = work2
  03-19 14:30:13.052: I/JSON(30510): jsonObj = work3
  03-19 14:30:13.062: I/JSON(30510): jsonObj = work4
  </code></pre>
  
  <p>This happen after i implement the setRequestedOrientation. Can anybody explain why thiss is happening and what are the solution for this. Thanks</p>
  
  <p>heres my onCreate class</p>
  
  <pre><code>public void onCreate(Bundle savedInstanceState) {
      setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
      Log.i("loop check", "loop");
      super.onCreate(savedInstanceState);
  
      this.requestWindowFeature(Window.FEATURE_NO_TITLE);
      this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
              WindowManager.LayoutParams.FLAG_FULLSCREEN);
  
      setContentView(R.layout.activity_work_listing);
  
      StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder()
              .permitAll().build();
      StrictMode.setThreadPolicy(policy);
  
      tblLay = (TableLayout) findViewById(R.id.tblLayout);
  
      jsonParser = new JSONParser();
      jObj = jsonParser.getJSONFromUrl(URL);
  
      txtOrderN = new TextView(getApplicationContext());
      txtCabinetN = new TextView(getApplicationContext());
      txtAssignP = new TextView(getApplicationContext());
      txtActualP = new TextView(getApplicationContext());
      txtStatS = new TextView(getApplicationContext());
  
      String jsonObj;
  
      for (int i = 0; i &lt; jObj.length(); i++) {
          jsonObj = "work";
          jsonObj = jsonObj + i;
  
          try {
              tblRow = new TableRow(getApplicationContext());
              Log.i("JSON", "jsonObj = " + jsonObj);
              txtOrderN.setText(jObj.getJSONObject(jsonObj).getString(
                      "orderN"));
              txtCabinetN.setText(jObj.getJSONObject(jsonObj).getString(
                      "cabinetN"));
              txtAssignP.setText(jObj.getJSONObject(jsonObj).getString(
                      "assignP"));
              txtActualP.setText(jObj.getJSONObject(jsonObj).getString(
                      "actualP"));
              txtStatS.setText(jObj.getJSONObject(jsonObj).getString("statS"));
              txtOrderN = new TextView(getApplicationContext());
              txtCabinetN = new TextView(getApplicationContext());
              txtAssignP = new TextView(getApplicationContext());
              txtActualP = new TextView(getApplicationContext());
              txtStatS = new TextView(getApplicationContext());
  
              tblRow.addView(txtOrderN);
              tblRow.addView(txtCabinetN);
              tblRow.addView(txtAssignP);
              tblRow.addView(txtActualP);
              tblRow.addView(txtStatS);
              tblLay.addView(tblRow);
  
          } catch (Exception e) {
              Toast.makeText(getApplicationContext(), "Error " + e,
                      Toast.LENGTH_LONG).show();
              Log.i("Error ", "" + e);
          }
  
      }
  
  }
  </code></pre>
  
  <p>AndroidManifest.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.zeta.workorder"
  android:versionCode="1"
  android:versionName="1.0" &gt;
  
  &lt;uses-sdk
      android:minSdkVersion="9"
      android:targetSdkVersion="18" /&gt;
  &lt;uses-permission android:name="android.permission.INTERNET"/&gt;
  
  &lt;application
      android:allowBackup="true"
      android:icon="@drawable/ic_launcher"
      android:label="@string/app_name"
      android:theme="@style/AppTheme" &gt;
      &lt;activity
          android:name="com.zeta.workorder.MainActivity"
          android:label="@string/app_name" &gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.MAIN" /&gt;
  
              &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
          &lt;/intent-filter&gt;
      &lt;/activity&gt;
      &lt;activity
          android:name="com.zeta.workorder.WorkListingActivity"
          android:label="@string/title_activity_work_listing" &gt;
      &lt;/activity&gt;
  &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>