title: Java using enum with switch statement
body: <p>I've looked at various Q&amp;As on SO similar to this question but haven't found a solution.</p>
  
  <p>What I have is an enum which represents different ways to view a TV Guide...</p>
  
  <p>In the NDroid <code>Application</code> class</p>
  
  <pre><code>static enum guideView {
      GUIDE_VIEW_SEVEN_DAY,
      GUIDE_VIEW_NOW_SHOWING,
      GUIDE_VIEW_ALL_TIMESLOTS
  }
  </code></pre>
  
  <p>...when the user changes the view an event handler receives an <code>int</code> from 0-2 and I'd like to do something like this...</p>
  
  <p>In an Android <code>Activity</code> <code>onClick(DialogInterface dialog, int which)</code> event handler</p>
  
  <pre><code>// 'which' is an int from 0-2
  switch (which) {
      case NDroid.guideView.GUIDE_VIEW_SEVEN_DAY:
      ...
      break;
  }
  </code></pre>
  
  <p>I'm used to C# enums and select/case statements which would allow something like the above and I know Java does things differently but I just can't make sense of what I need to do.</p>
  
  <p>Am I going to have to resort to <code>if</code> statements? There will likely only ever be 3 choices so I could do it but I wondered how it could be done with switch-case in Java.</p>
  
  <p><strong>EDIT</strong> Sorry I didn't completely expand on the issue as I was looking at it as being a generic Java issue. I've added to the question to explain a bit further.</p>
  
  <p>There isn't anything that's Android specific which is why I didn't tag it as Android but the enum is defined in the <code>Application</code> class and the code where I wan't the switch is in an <code>Activity</code>. The enum is static as I need to access it from multiple Activities.</p>