The best solution that I came up with was to use a TwitterButton instead of a TwitterAuthClient. Check out the code:
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:
So you have some color like R.color.black and you want to add transparency to it. Rather than storing that value inside the colors.xml file, you can do so programmatically.
If you are using the support library, you can use ColorUtils.setAlphaComponent(color, alpha) method.
If you want using basic Java, do it like this: (color & 0x00ffffff) | (alpha << 24).
Remember, the color value is not R.color.mycolor. I use the Compat library all the time so I convert the R.color.mycolor variable to ContextCompat.getColor(context, R.color.mycolor) then pass that to the formula above or the setAlphaComponent() parameter.
The solution that worked for me was to set the height of the WebView widget to wrap_content. Then aligning it in the middle vertically.