Skip to content

Instantly share code, notes, and snippets.

@sys1yagi
Last active February 28, 2019 23:25
Show Gist options
  • Save sys1yagi/d252fdd9474a006f922b66d5fe0bedbc to your computer and use it in GitHub Desktop.
Save sys1yagi/d252fdd9474a006f922b66d5fe0bedbc to your computer and use it in GitHub Desktop.
// deprecatedだけど新しいのは API 23からなので仕方ない
val intent = AccountManager.newChooseAccountIntent(
null,
null,
arrayOf("com.google"),
true,
null,
null,
null,
null
)
// onActivityResultで取り出す
val name = data?.getStringExtra(AccountManager.KEY_ACCOUNT_NAME)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment