title: Android Studio - Start an Activity with a parameter
body: <p>I am new with Android Studio. I am working on following code but it is not working, kindly help me out.</p>
  
  <p>I am trying to send an int value but emulator stopped working every time.</p>
  
  <p>From class page1 to page2.
  On page1:</p>
  
  <pre><code>        b1.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
              Intent intent = new Intent(page1.this, page2.class);
              Bundle b = new Bundle();
              b.putInt("key", 1); //Your id
              intent.putExtras(b); //Put your id to your next Intent
              startActivity(intent);
          }
      });
  </code></pre>
  
  <p>On page2: I am writing this code in onCreate function.</p>
  
  <pre><code>    Bundle coming = getIntent().getExtras();
      int value = coming.getInt("key");
      paper.setText(value);
  </code></pre>