Load bundle based on what button pressed
<p>I have two buttons in one class and those buttons send you to the same class but depending on what button that was pressed it will show different text/images/buttons.</p>

<p>So right now when a button is pressed it send you to the next class and adds some intets, like this:</p>

<pre><code>button1.setOnClickListener(new View.OnClickListener() {  
            @Override  
              public void onClick(View view) {  
                Bundle bundle1 = new Bundle();  
                bundle1.putInt("top", R.drawable.1);  
                bundle1.putInt("mid", R.drawable.2);  
                bundle1.putInt("bot", R.drawable.3);  
                Intent intet1 = new Intent(curclass.this, nextclass.class);  
                intent1.putExtras(bundle1);  
                startActivity(intent1);
</code></pre>

<p>In the next class I have a bundle for each button but I belive I need to set a if/else on them to make sure it only uses one of the bundles because it does not work properly right now.</p>

<p>So how do I make the "if" thing?
I have tried but I don't know what to put after "if".
Something like   </p>

<pre><code>"if (button1 = pressed)  
(do this)  
else if (button2 = pressed)  
(do this)"
</code></pre>

<p>Thanks in advance!</p>

<p>Sorry if I explain like a idoit, might be because I am one and I just started to program.</p>

<p>EDIT: The problem is that I have two bundles in the second activity that looks like this:</p>

<pre><code>Bundle asd = getIntent().getExtras();
    int asdasd = asd.getInt("top");
    im1 = (ImageView) findViewById(R.id.imagetop);
    im1.setImageResource(newimage);
    bu1 = (Button) findViewById(R.id.buttontop);
    bu1.setText("blahblah");
</code></pre>

<p>And I have the mid and bot one under that and then i have the second bundle which tells the Ints from button2 what images/texts to show and the problem is that it loads that second bundles stuff even if I press button1, which I suspect is caused by the bundles just being there side by side with anything telling them what to do.</p>

<p>I hope that clears it up :)</p>
