Tech Tips & Tricks

tech tips gadgets programming software

  • Archives
  • Categories
  • Contact Me
Donations gladly accepted to help keep this blog alive. Thank You.


Banner Ads

Get Your #PurpleTicket - Sign up for IZEA SeedingUp | Digital Content Marketing make money with your web site postjoint



Blog Advertising - Advertise on blogs with SponsoredReviews.com

Link From Blog

Link Vehicle
Error processing request

Month: September 2016

Connect To Twitter Using Fabric Programmatically

September 29, 2016 by blogmeister·0 Comments

Share the post "Connect To Twitter Using Fabric Programmatically"

  • Facebook
  • Twitter
  • Google+
  • Pinterest
  • LinkedIn

The best solution that I came up with was to use a TwitterButton instead of a TwitterAuthClient. Check out the code:

Java
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:

Java
1
twitterButton.onActivityResult(requestCode, resultCode, data);

Related Posts Plugin for WordPress, Blogger...
Proudly powered by WordPress. Theme: Flat 1.7.8 by Themeisle.