HttpURLConnection hat in Android 2.x einwandfrei funktioniert, aber NICHT in 4.1: Keine Authentifizierungsprobleme gefunden

Ich habe einige typische Codes, die HttpURLConnection verwendeten, um eine Datei mit einer URL zu erhalten. Sie funktionierten gut in Android 1.x und 2.x. Aber in Android 4.1 gescheitert!

Ich habe im Internet gesucht, aber nur wenige ähnliche Informationen gefunden. Würde jemand bitte helfen, dieses Problem zu untersuchen?

private String mURLStr; 
private HttpURLConnection mHttpConnection;

...

url = new URL(mURLStr);

...

mHttpConnection = (HttpURLConnection) url.openConnection();
mHttpConnection.setDoOutput(true);
mHttpConnection.setRequestMethod("GET");

...

InputStream is = mHttpConnection.getInputStream();

Die Methode getInputStream löst eine Ausnahme aus:

08-01 15:56:48.856: W/System.err(13613): java.io.IOException: No authentication challenges found
08-01 15:56:48.856: W/System.err(13613):      at libcore.net.http.HttpURLConnectionImpl.getAuthorizationCredentials(HttpURLConnectionImpl.java:427)
08-01 15:56:48.866: W/System.err(13613):      at libcore.net.http.HttpURLConnectionImpl.processAuthHeader(HttpURLConnectionImpl.java:407)
08-01 15:56:48.866: W/System.err(13613):      at libcore.net.http.HttpURLConnectionImpl.processResponseHeaders(HttpURLConnectionImpl.java:356)
08-01 15:56:48.866: W/System.err(13613):      at libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:292)
08-01 15:56:48.866: W/System.err(13613):      at libcore.net.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:168)
...

Antworten auf die Frage(9)

Ihre Antwort auf die Frage