Share the post "Connect To Twitter Using Fabric Programmatically"
The best solution that I came up with was to use a TwitterButton instead of a TwitterAuthClient. Check out the code:
|
1 |
twitterButton.performClick(); |
Using TwitterAuthClient is also okay but if you plan to make it as a static variable, Android Studio will show up with a warning that since this uses a context, leaks may be possible which is the reason why I decided to use the TwitterButton class instead.
Instantiate the TwitterButton class and call the performClick() method.
Make sure in your in the onActivityResult() of your Activity class, you call this code:
|
1 |
twitterButton.onActivityResult(requestCode, resultCode, data); |