title: Receiving data from other application comes null in android
body: <blockquote>
    <p>I want to make my application like Instagram i can share pictures
    directly from  my application  , like if i select any image from
    gallery and when click on share my application shows on the list of chooser </p>
  </blockquote>
  
  <pre><code>&lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;
  &lt;uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /&gt;
  
  
  &lt;activity
                  android:name=".ui.activities.SplashActivity"
                  android:label="@string/app_name"
                  android:launchMode="singleTop"
                  android:screenOrientation="sensorPortrait"
                  android:windowSoftInputMode="adjustResize" &gt;
                  &lt;intent-filter&gt;
                      &lt;action android:name="android.intent.action.SEND" /&gt;
  
                      &lt;category android:name="android.intent.category.DEFAULT" /&gt;
  
                      &lt;data android:mimeType="*/*" /&gt;
                  &lt;/intent-filter&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;
  </code></pre>
  
  <p>Code for receiving data from intent is </p>
  
  <pre><code>private void initActivityState() {
          if (getIntent() != null){
              runShareActivityIntent();
          }
  }
  public void runShareActivityIntent(){
          Intent passIntent=getIntent();
          String action = passIntent.getAction();
          String type = passIntent.getType();
  
          if (Intent.ACTION_SEND.equals(action) &amp;&amp; type != null) {
              Uri imageUri = (Uri) passIntent.getParcelableExtra(Intent.EXTRA_STREAM);    
              Intent intentcall = new Intent(this, MainActivity.class);
              intentcall.putExtra(KEY_TYPE,type);
              intentcall.putExtra(KEY_VALUE,imageUri.toString());
              startActivity(intentcall);
              finish();
          }
  
      }
  </code></pre>
  
  <p>Now in my case when my app is in background i am able to get</p>
  
  <pre><code>String type = passIntent.getType();
  </code></pre>
  
  <blockquote>
    <p>and i am able to get image uri but when my app is not running( kill app ) and i
    select my application from chooser i get type as null</p>
  </blockquote>