title: Android case statement help
body: <p>I'm trying to make my case statement open up a different class depending on what button is pressed. I got this working fine for one button but am unsure how to proceed for two buttons.</p>
  
  <p>Heres my code so far:</p>
  
  <pre><code>public void onClick(View v) {
      switch (v.getId()) {
      case R.id.about_button:
          Intent i = new Intent(this, About.class);
          startActivity(i);
          break;
      case R.id.reminderList_button:
          Intent i = new Intent (this, ReminderListActivity.class);
          startActivity(i);
          break;
  
      }
  
  }
  </code></pre>
  
  <p>This gives an error because I'm reusing the local variable (i) - if anyone could let me know how to do this properly it would be much appreciated.</p>