【发布时间】:2013-10-16 15:53:01
【问题描述】:
我正在使用 LoopJ AndroidAsyncHttp 下载图像,但是当我尝试使用 HTTPS URL 时,我没有得到任何响应。 代码:
AsyncHttpClient client = new AsyncHttpClient();
client.get(httpsUrlString, new BinaryHttpResponseHandler(allowedContentTypes) {
@Override
public void onSuccess(byte[] fileData) {
Bitmap bitmap = BitmapFactory.decodeByteArray(fileData, 0, fileData.length);
image.setImageBitmap(bitmap);
}
});
【问题讨论】:
-
如果您能告诉我们您的尝试,那就太好了。您是否尝试过覆盖 onfailure 或其他任何方法?
-
查看如何接受所有证书的示例:github.com/loopj/android-async-http/issues/288
-
不是接受所有证书的最佳方式,如果你这样做,使用 HTTPS 毫无意义。你应该看看:stackoverflow.com/questions/12018681/…
-
使用 HttpsURLConnection developer.android.com/reference/javax/net/ssl/…
标签: android image https android-async-http