title: How to pass value using Intent between Activity in Android?
body: <p>I want to pass the value of the position in one activity class to another...</p>
  
  <p>My code is as follows:</p>
  
  <pre><code>protected void onListItemClick(ListView listView, View v, int position,
              long id) {
          switch (position) {
              case 1:
                  Intent newActivity1 = new Intent(this, BucketItemActivity.class);
                  newActivity1.putExtra("bucketno", position);
                  startActivity(newActivity1);
                  break;
              case 2:
                  Intent newActivity2 = new Intent(this, BucketItemActivity.class);
                  newActivity2.putExtra("bucketno", position);
                  startActivity(newActivity2);
                  break;
      }
  }
  </code></pre>
  
  <p>The activity class that will receive it..</p>
  
  <pre><code>protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_bucket_item);
          String value = getIntent().getExtras().getString("bucketno");
          TextView textView = new TextView(this);
          textView.setTextSize(40);
          textView.setText(value);
          setContentView(textView);
      }
  </code></pre>
  
  <p>But i always get a null in the String value...</p>
  
  <p>Please help.</p>