Android如何在授权Facebook时设置超时?

时间:2012-06-11 06:23:42

标签: android facebook timeout authorize

我有一些连接Facebook的代码:

facebook.authorize(((Activity) ctx).getParent(), new String[] {},
                requestCode, new DialogListener() {}

通常它工作正常。但有时我连接到一些网络不允许连接到Facebook。然后authorize方法将抛出

 com.facebook.android.DialogError: The connection to the server was unsuccessful

在我的手机上,大约需要20秒才能抛出异常。但在其他一些设备上,花了很长时间(可能是因为不同设备上的设置不同,我不确定)。当网络不允许连接到Facebook时,有没有办法设置超时。

0 个答案:

没有答案