1

Android - Asynctask always timing out in android 4.1.1 (Galaxy Tab 2)

view story
linux-howto

http://stackoverflow.com – I have a very strange problem. My app uses an async task to make an http request. Everything works fine in lower versions, but when I test on a Samsung galaxy Tab 2 with Android 4.1.1 the asynctask ALWAYS throws a TimeoutException. Here's how I use the code. 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 (HowTos)