Android-Asynctask在Android 4.1.1中总是超时(Galaxy选项卡2)

Android-Asynctask在Android 4.1.1中总是超时(Galaxy选项卡2),android,android-asynctask,timeoutexception,Android,Android Asynctask,Timeoutexception,我有一个很奇怪的问题 我的应用程序使用异步任务发出http请求。 在较低版本中一切都正常,但当我在三星galaxy Tab 2上测试Android 4.1.1时,asynctask总是抛出TimeoutException 下面是我如何使用代码 try { response = new HttpContents(getApplicationContext()).execute(url).get(4000, TimeUnit.MILLISECONDS); // the .get(40

我有一个很奇怪的问题

我的应用程序使用异步任务发出http请求。 在较低版本中一切都正常,但当我在三星galaxy Tab 2上测试Android 4.1.1时,asynctask总是抛出TimeoutException

下面是我如何使用代码

try {
    response = new HttpContents(getApplicationContext()).execute(url).get(4000, TimeUnit.MILLISECONDS);
    // the .get(4000,...) part will force a Timeout after 4 secs, but it doesn't happen in pre-honeycomb. Only in android 4+
} catch (TimeoutException e) {
    // Log.e("WEB TO EXCEPTION",e.toString());
    return null; // This doesn't matter.
}
HttpContents是外部AsyncTaks类(返回内容)

在我测试的较低android版本上,我得到了正确的响应。

我不是从主线程运行它(因此,它不会冻结我的UI)

出于某种原因,http响应正是在抛出异常时返回的。asynk任务在另一个asynctask的doInBackground中执行是否有问题(在android 4.0中)。因为这就是我的问题所在

为什么我只在ICS上获得此超时异常而在较低版本上没有。
是否存在与此相关的任何已知问题?

异常是否设置了字符串字段?Log.e(“WEB到异常”,e.toString())是什么;打印输出?我只使用了1个asynktask进行了测试,UI最初被冻结,直到收到http响应。我不喜欢这个。它在蜂窝式设备上运行良好@frogmanx WEB到异常(11460):java.util.concurrent.TimeoutException。这当然是因为我放了.get(4000…)。我正在强制超时(但只有在出现网络问题时才会发生)。而且这种情况不会发生在蜂巢前期。