Created
September 9, 2013 20:47
-
-
Save christoffer/6501288 to your computer and use it in GitHub Desktop.
Missing symbols from ruby.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.my.package; | |
static import com.my.package.Symbols.*; | |
class MyClass { | |
// Symbol constants | |
enum Symbols { EXTRA_SOME_KEY } | |
void unpackExtras() { | |
Bundle extras = getIntent().getExtras(); | |
// Explicit, three step rocket | |
extras.getString(Symbols.EXTRA_SOME_KEY.name()); | |
// Using the statically imported enum | |
extras.getString(EXTRA_SOME_KEY.name()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's a bit nasty for external usage though.