title: Multiple different calls to same activity issue
body: <p>I have a simple application with which iam displaying weblinks in webviews.
  i have two webViews one for links i want to open in portrait or in landscape</p>
  
  <p>my code works well when i have only a single intent call and handling only one in the requested activity</p>
  
  <p>now from my mainActivty i am sending the intent calls on the button click
  here's the code </p>
  
  <pre><code> protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      Button intra = (Button) findViewById(R.id.buttonIntra);
      intra.setOnClickListener(new View.OnClickListener() {
          public void onClick(View v) {
              Intent launchactivity = new Intent(MainActivity.this,
                      potraitWebview.class);
              launchactivity
                      .putExtra("QI",
                              "https://TEST.COM");
              launchactivity.putExtra("viewport", t);
              launchactivity.putExtra("overviewmode", t);
  
              startActivity(launchactivity);
              finish();
          }
      });
  
      Button chat = (Button) findViewById(R.id.buttonChat);
      chat.setOnClickListener(new View.OnClickListener() {
          public void onClick(View v) {
              Intent launchactivity = new Intent(MainActivity.this,
                      potraitWebview.class);
              launchactivity.putExtra("chat",
                      "http://CHAT.COM");
              launchactivity.putExtra("viewport", t);
              launchactivity.putExtra("overviewmode", t);
              startActivity(launchactivity);
              finish();
          }
      });     
  
  }
  </code></pre>
  
  <p>Now the activity i am calling im using this code to handle these requests and display the webpages</p>
  
  <pre><code> protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
      setContentView(R.layout.potraitlayout);
      getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE,
              R.layout.customtitlebar);
      web = (WebView) findViewById(R.id.webViewPotrait);
  
      // Handling incoming activity requests
  
      Bundle intraExtras = getIntent().getExtras();
      if (intraExtras != null) {
          String value = intraExtras.getString("QI");
          viewport = intraExtras.getBoolean("viewport", false);
          overviewmode = intraExtras.getBoolean("overviewmode", false);
          url = value.trim();
          Toast.makeText(getApplicationContext(), value+" "+viewport+" "+overviewmode, Toast.LENGTH_SHORT)
                  .show();
      }
  
      Bundle chat = getIntent().getExtras();
      if (chat != null) {
          String value = chat.getString("chat");
          viewport = chat.getBoolean("viewport", false);
          overviewmode = chat.getBoolean("overviewmode", false);
          url = value.trim();
          Toast.makeText(getApplicationContext(), value+" "+viewport+" "+overviewmode, Toast.LENGTH_SHORT)
                  .show();
      }
  </code></pre>
  
  <blockquote>
    <p><em>the issue here is <strong>getIntent().getExtras();</strong> which i am using if it is null for any of the activity requests which has not been currently
    called the application crashes</em></p>
  </blockquote>
  
  <p>logcat</p>
  
  <pre><code>    05-02 11:33:49.153: E/AndroidRuntime(19950): FATAL EXCEPTION: main
  05-02 11:33:49.153: E/AndroidRuntime(19950): Process: com.android.qintra, PID: 19950
  05-02 11:33:49.153: E/AndroidRuntime(19950): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.qintra/com.android.qintra.potraitWebview}: java.lang.NullPointerException
  05-02 11:33:49.153: E/AndroidRuntime(19950):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2209)
  05-02 11:33:49.153: E/AndroidRuntime(19950):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2269)
  05-02 11:33:49.153: E/AndroidRuntime(19950):    at android.app.ActivityThread.access$800(ActivityThread.java:139)
  05-02 11:33:49.153: E/AndroidRuntime(19950):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1210)
  05-02 11:33:49.153: E/AndroidRuntime(19950):    at android.os.Handler.dispatchMessage(Handler.java:102)
  05-02 11:33:49.153: E/AndroidRuntime(19950):    at android.os.Looper.loop(Looper.java:136)
  05-02 11:33:49.153: E/AndroidRuntime(19950):    at android.app.ActivityThread.main(ActivityThread.java:5102)
  05-02 11:33:49.153: E/AndroidRuntime(19950):    at java.lang.reflect.Method.invokeNative(Native Method)
  05-02 11:33:49.153: E/AndroidRuntime(19950):    at java.lang.reflect.Method.invoke(Method.java:515)
  05-02 11:33:49.153: E/AndroidRuntime(19950):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
  05-02 11:33:49.153: E/AndroidRuntime(19950):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
  05-02 11:33:49.153: E/AndroidRuntime(19950):    at dalvik.system.NativeStart.main(Native Method)
  05-02 11:33:49.153: E/AndroidRuntime(19950): Caused by: java.lang.NullPointerException
  05-02 11:33:49.153: E/AndroidRuntime(19950):    at com.android.qintra.potraitWebview.onCreate(potraitWebview.java:54)
  05-02 11:33:49.153: E/AndroidRuntime(19950):    at android.app.Activity.performCreate(Activity.java:5248)
  05-02 11:33:49.153: E/AndroidRuntime(19950):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1110)
  05-02 11:33:49.153: E/AndroidRuntime(19950):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2173)
  05-02 11:33:49.153: E/AndroidRuntime(19950):    ... 11 more
  </code></pre>
  
  <p><strong>line 54 is
  <a href="http://i.stack.imgur.com/5Ctse.png" rel="nofollow">http://i.stack.imgur.com/5Ctse.png</a></strong></p>