且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Android的发布到Facebook的图像超时

更新时间:2023-12-01 20:40:10

看起来不像你可以超时在当前code中的要求。

Doesn't look like you can timeout the request in the current code.

的 Facebook的对象调用的的OpenURL 的的的Util 类。
此方法使用 HttpURLConnection类类发出请求,并且它具有 setConnectTimeout 方法,您可以使用超时请求,但Facebook的实施不会让你传递一个参数,也许因为这种方法是从Java 1.5版新他们想要的SDK为较低的版本。

The Facebook object calls the openUrl method of the Util class. This method uses the HttpURLConnection class to make the request, and it has the setConnectTimeout method which you can use to timeout the request, but the facebook implementation does not let you pass a parameter for it, maybe since this method is new from java version 1.5 and they wanted the SDK to work for lower versions.

如果您在1.5或更高版本上运行你的应用程序,那么你可以简单地修改code你有Facebook的SDK,包括超时。

If you run your application on 1.5 or higher then you can simply modify the code you have for the facebook SDK to include timeout.