Last active
December 24, 2015 06:29
-
-
Save lethargicpanda/6757287 to your computer and use it in GitHub Desktop.
Check if there is at least one user authenticated on Twitter.
Note: this can work for any other app using the AccountManager for the authentication if you pass the right "type". e.g. for vine: "co.vine.android.auth"
e.g. for linkedin: "com.linkedin.android"
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
public boolean isTwitterSignedIn(){ | |
AccountManager manager = AccountManager.get(this); | |
Account[] account = manager.getAccountsByType("com.twitter.android.auth.login"); | |
if (account.length > 0) { | |
Log.d("MainActivity", "Authenticated on twitter!"); | |
return true; | |
} else { | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment