title: Why doesn't Android use more enums?
body: <p>I've started to really like using C# and Java enums in my code for several reasons:</p>
  
  <ul>
  <li>They are much more type-safe than integers, strings, or sets of boolean flags.</li>
  <li>They lead to more readable code.</li>
  <li>It's more difficult to set an enum to an invalid value than an int or string.</li>
  <li>They make it easy to discover the allowed values for a variable or parameter.</li>
  <li>Everything I've read indicates that they perform just as well as integers in C# and most JVMs.</li>
  </ul>
  
  <p>However, the Android framework has numerous cases where flags of various types need to be passed around, but none of them seem to use enums.  A couple of examples where I would think their use would be beneficial are <code>Toast.LENGTH_SHORT</code> / <code>Toast.LENGTH_LONG</code> and <code>View.GONE</code>, <code>View.VISIBLE</code>, etc.</p>
  
  <p>Why is this?  Do enums perform worse than simple integer values in Dalvik?  Is there some other drawback I'm not aware of?</p>