简体   繁体   English

用于在Android上使用Twitter4j,OAuth检索用户时间线的小工具

[英]Widget for retrieving the timeline of a user with Twitter4j, OAuth on Android

I see the sample codes and walkthroughs on how to register your application, get the pin/uid and retrieve the access token and use it in the OnNewIntent method. 我看到了有关如何注册应用程序,获取pin / uid和检索访问令牌并在OnNewIntent方法中使用它的示例代码和演练。

How can I do this OAuth authentication for a widget instead of an application? 如何为窗口小部件而不是应用程序执行此OAuth身份验证?

You need to start an Activity and start the Oauth flow from there. 您需要启动一个Activity并从那里启动Oauth流。

You can use setOnClickPendingIntent to start an Activity if the user clicks on a part of the Widget, or use a Configuration Activity to have the user authenticate himself the moment the widget is placed on the homescreen. 如果用户单击Widget的一部分,则可以使用setOnClickPendingIntent启动Activity,或者在窗口小部件放置在主屏幕上时使用配置活动让用户对自己进行身份验证。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM