title: android - switch case and its return value
body: <p>For my new app I need to print numbers chosen from a switch case. My switch cases should randomly pick an image and after that, the if statement should check which one was chosen and then change the score. The problem I have is, that my if statements get errors, because of <code>Unreachable Code</code>.</p>
  
  <pre><code>public class MainActivity extends ActionBarActivity {
  
      TextView score;
      public int newscore;
  
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          score = (TextView) findViewById(R.id.textView1);    
      }
  
          int Id() {
          Random rand = new Random();
          int imag = rand.nextInt(4);
          switch (imag) {
           case 0:
               score.setText(newscore);
               return R.drawable.a;
           case 1:
               score.setText(newscore);
               return R.drawable.b;
           case 2:
               score.setText(newscore);
               return R.drawable.c;
           default:
              score.setText(newscore);
              return R.drawable.d;
          }
  
          if(Id() == R.drawable.a){ 
              newscore = newscore+1;
          }
  
          if(Id() == R.drawable.b){ 
              newscore = newscore+10;
          }
  
          if(Id() == R.drawable.c){
              newscore = newscore+100;
          }
  
          if(Id() == R.drawable.d){ 
              newscore = newscore+1000;
          }
  
  
          }
  
  
      }
  </code></pre>