Skip to content

Instantly share code, notes, and snippets.

@copyninja
Created September 26, 2010 16:24
Show Gist options
  • Save copyninja/598075 to your computer and use it in GitHub Desktop.
Save copyninja/598075 to your computer and use it in GitHub Desktop.
btnLogin = (Button) findViewById(R.id.btnLogin);
btnLogin.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
try {
String authURL = provider.retrieveRequestToken(
consumer, CALLBACK_URL);
Log.d("OAuthTwitter", authURL);
startActivity(new Intent(Intent.ACTION_VIEW, Uri
.parse(authURL)));
} catch (OAuthMessageSignerException e) {
e.printStackTrace();
} catch (OAuthNotAuthorizedException e) {
e.printStackTrace();
} catch (OAuthExpectationFailedException e) {
e.printStackTrace();
} catch (OAuthCommunicationException e) {
e.printStackTrace();
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment