title: Intent from one two activities to one
body: <p>I have 3 activities Activity A,Activity B, and Activity C. I'm passing an intent from Activity A to Activity B with some values. And Activity B is receiving it without any problems. But the problem arises when I start Activity B from <code>onBackPress()</code> of Activity C . I have overridden the <code>onBackPress()</code> in Activity C and put the intent code in there. I only want to start activity B from Activity C and not pass any intent extra values. But when I press the back button, it gives me NPE because no value was received by the intent in Activity B. How to solve this?</p>
  
  <p>Basically what I need is the intent in Activity B should receive values from Activity A and not from Activity C.</p>
  
  <p>Activity A:</p>
  
  <pre><code> public void onClick(View view) {
  
              Intent i = new Intent(this, ActivityB.class);
              i.putExtra("artist_id", artistsModel.getArtistID());
              aContext.startActivity(i);
  
  
          } 
  </code></pre>
  
  <p>Activity B:</p>
  
  <pre><code> ArtistId = getIntent().getExtras().getLong("artist_id");
  
   public void onClick(View view) {
  
  
                          Intent intent1 = new Intent(getApplicationContext(),ActivityC.class);
                          intent1.putExtra("ArtistIDs", ArtistId );
                          startActivity(intent1);
  
  
                      }
  </code></pre>
  
  <p>Activity C:</p>
  
  <pre><code> public void onBackPressed() {
  
      Intent i = new Intent(this , ActivityB.class);
      startActivity(i);
  }
  </code></pre>