Skip to content

Instantly share code, notes, and snippets.

@hackugyo
Last active December 9, 2015 07:46
Show Gist options
  • Save hackugyo/5018e4df385db0bd00ab to your computer and use it in GitHub Desktop.
Save hackugyo/5018e4df385db0bd00ab to your computer and use it in GitHub Desktop.
Androidでstatic finalなインスタンスが複雑な場合、こうやって初期化する
static final String AUTH_TOKEN_TYPE;
static {
StringBuilder sb = new StringBuilder();
sb.append("oauth2:");
for (String scope : AUTH_SCOPES) {
sb.append(scope);
sb.append(" ");
}
AUTH_TOKEN_TYPE = sb.toString();
}
// staticなインスタンスが複雑な場合、こうやって初期化する
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment