title: Imageview to show different image depending on Int
body: <p>I have a random number generator and I need to display different image,
  depending on different Int values. </p>
  
  <p>For example when randomNumber is let's say 1, I need to show specific text and image
  and when number is 10 another specific text and image etc..</p>
  
  <p>Can I even do that with ImageView, I do not know where to start?</p>
  
  <pre><code>    package com.example.drinktivity;
  
      import android.os.Bundle;
      import android.app.Activity;
      import android.content.Intent;
      import android.view.Menu;
      import android.view.View;
      import android.widget.Button;
      import android.widget.TextView;
  
  
      public class Main2Activity extends Activity {
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main2);
  
  
  Button back = (Button) findViewById(R.id.buttonback); // Here the R.id.button1 is the button from you design
  back.setOnClickListener(new View.OnClickListener() {
  public void onClick(View arg0) {
  Intent i = new Intent(Main2Activity.this, MainActivity.class);
  startActivity(i);
  }
  });
  
  ImageView image = (ImageView) findViewById(R.id.imageView1);
  Bundle bundle = getIntent().getExtras();
  int random = bundle.getInt("Value");
  TextView text = (TextView) findViewById(R.id.textView1);
  if (random==1) {
      text.setText("");
  }
  if (random==2) {
      text.setText("");
  }
  if (random==3) {
      text.setText("");
  }
  if (random==4) {
      text.setText("");
  }
  if (random==5) {
      text.setText("");
  }
  if (random==6) {
      text.setText("");
  }
  if (random==7) {
      text.setText("");
  }
  if (random==8) {
      text.setText("");
  }
  if (random==9) {
      text.setText("");
  }
  if (random==10) {
      text.setText("");
  }
  
  
  }
  
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
      // Inflate the menu; this adds items to the action bar if it is present.
      getMenuInflater().inflate(R.menu.main, menu);
      return true;
  }
  
      }
  </code></pre>