Trying to send a view's id with an intent. Getting "false"
<p>This class has information that I want to send with an intent to another activity. When the image button "superman" is pressed the onClick() handler sends an intent to SuperheroActivity. But when I try and retrieve that information in the other activity I get "false".</p>

<pre><code>public class MenuActivity extends Activity implements
    OnClickListener {
private ImageButton superman;

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.menu);

    superman = (ImageButton) findViewById(R.id.superman);
    superman.setOnClickListener(this);
}

@Override
public void onClick(View v) {
    Intent intent = new Intent(MenuActivity.this, SuperheroActivity.class);
    intent.putExtra("id", v.getId());
    startActivity(intent);
}
</code></pre>

<p>}</p>

<p>This is the piece of code that tries to retrieve the information from the intent. Note: This is SuperheroActivity.</p>

<pre><code>Intent intent = getIntent();
id = intent.getIntExtra("id", 0);
// This is just a dirty way for me to see the value of the id I am getting.
TextView text = (TextView) findViewById(R.id.superheroText); 
text.setText(id);
</code></pre>
