开发者

Create Facebook API-like WebView pop-up in Android

开发者 https://www.devze.com 2023-02-07 14:06 出处:网络
I have Facebook and Twitter integration in my app. For Facebook I use the API they provided and for Twitter I open a WebView for Oauth.

I have Facebook and Twitter integration in my app. For Facebook I use the API they provided and for Twitter I open a WebView for Oauth.

To save the Twitter key I get back from Oauth I have to use CallBack. However using CallBack lets the user see a black screen (for less than a second) before going to the activity with the sharing options.

Is there a way I can avoid this black screen.

Or better:

Can I make a WebView pop-up like the Facebook API does? If yes, how 开发者_C百科can I achieve this and how can I save the key I get back from Oauth?


I had the same problem that you and I created a Twitter Login Button library which do the same as the Facebook Login Button provided in the example of the Android API. You can found the code on Google Code.

Basically it display a webview containing Twitter website to allow the user to click on Allow and save the token and token secret. You can easily use this library with Twitter4j for example.

0

精彩评论

暂无评论...
验证码 换一张
取 消