title: Android check action in intent and do some logic
body: <p>I set two intent filters in one activity.
  ` </p>
  
  <pre><code>        &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;intent-filter&gt;
              &lt;action android:name="android.intent.action.VIEW" /&gt;
              &lt;data  android:scheme="https://dou.ua/lenta/" /&gt;
              &lt;category android:name="android.intent.category.DEFAULT" /&gt;
          &lt;/intent-filter&gt; `
  </code></pre>
  
  <p>And check try to check action in creating activity.</p>
  
  <pre><code> protected void onCreate(@Nullable Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main_layout);
      ButterKnife.bind(this);
      mToolbar = (Toolbar) findViewById(R.id.toolbar);
      setSupportActionBar(mToolbar);
  
      Intent intent = getIntent();
      String action = intent.getAction();
      if (action.equals("android.intent.action.VIEW ")) {
  
      } else {
        getSupportFragmentManager().addOnBackStackChangedListener(this);
        isDisplayingHomeBtn();
        getSupportFragmentManager().beginTransaction()
            .replace(R.id.container, new FeedFragment())
            .commit();
      }
    }
  </code></pre>
  
  <p><strong>but i have a NullPointerException</strong></p>
  
  <blockquote>
    <p>Process: com.bogdan_kolomiets_1996.bogdan.dou_feed, PID: 5237
                                                                                             java.lang.RuntimeException: Unable to start activity
    ComponentInfo{com.bogdan_kolomiets_1996.bogdan.dou_feed/com.bogdan_kolomiets_1996.bogdan.dou_feed.ui.MainActivity}:
    java.lang.NullPointerException: Attempt to invoke virtual method
    'java.lang.Object android.os.Bundle.get(java.lang.String)' on a null
    object reference
                                                                                                 at
    android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2622)
                                                                                                 at
    android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2692)
                                                                                                 at android.app.ActivityThread.access$800(ActivityThread.java:179)
                                                                                                 at
    android.app.ActivityThread$H.handleMessage(ActivityThread.java:1540)
                                                                                                 at android.os.Handler.dispatchMessage(Handler.java:111)
                                                                                                 at android.os.Looper.loop(Looper.java:194)
                                                                                                 at android.app.ActivityThread.main(ActivityThread.java:5795)
                                                                                                 at java.lang.reflect.Method.invoke(Native Method)
                                                                                                 at java.lang.reflect.Method.invoke(Method.java:372)
                                                                                                 at
    com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1005)
                                                                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:800)
                                                                                                 at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:114)
                                                                                              Caused by: java.lang.NullPointerException: Attempt to invoke virtual
    method 'java.lang.Object android.os.Bundle.get(java.lang.String)' on a
    null object reference
                                                                                                 at
    com.bogdan_kolomiets_1996.bogdan.dou_feed.ui.MainActivity.onCreate(MainActivity.java:38)
                                                                                                 at android.app.Activity.performCreate(Activity.java:6071)
                                                                                                 at
    android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)
                                                                                                 at
    android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2575)
                                                                                                 at
    android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2692) 
                                                                                                 at android.app.ActivityThread.access$800(ActivityThread.java:179) 
                                                                                                 at
    android.app.ActivityThread$H.handleMessage(ActivityThread.java:1540) 
                                                                                                 at android.os.Handler.dispatchMessage(Handler.java:111) 
                                                                                                 at android.os.Looper.loop(Looper.java:194) 
                                                                                                 at android.app.ActivityThread.main(ActivityThread.java:5795) 
                                                                                                 at java.lang.reflect.Method.invoke(Native Method) 
                                                                                                 at java.lang.reflect.Method.invoke(Method.java:372)</p>
  </blockquote>