Android Facebook图形请求的解码流错误
您好,我已经在我的应用程序中实现了Facebook登录,现在正在尝试下载用户档案图片并将其传递到RoundeImage视图中 但是,我在测试时遇到错误,并且没有显示图像,错误是:Android Facebook图形请求的解码流错误,android,facebook,facebook-graph-api,Android,Facebook,Facebook Graph Api,您好,我已经在我的应用程序中实现了Facebook登录,现在正在尝试下载用户档案图片并将其传递到RoundeImage视图中 但是,我在测试时遇到错误,并且没有显示图像,错误是: skia﹕ --- SkImageDecoder::Factory returned null 我也得到了这两个错误之前,它直接 ReadStreamToBuffer : Qmage Stream read error!! required length 12 bytes, but red 0 bytes isQma
skia﹕ --- SkImageDecoder::Factory returned null
我也得到了这两个错误之前,它直接
ReadStreamToBuffer : Qmage Stream read error!! required length 12 bytes, but red 0 bytes
isQmage : input SkStreamRewindable length is less than Qmage minimum size : 0
这是我下载和设置映像的主要任务
private class DownloadImageTask extends AsyncTask<String, Void, Bitmap> {
private ImageView bmImage;
public DownloadImageTask(ImageView bmImage) {
this.bmImage = bmImage;
}
protected void onPreExecute() {
}
protected Bitmap doInBackground(String... urls) {
String userId = urls[0];
Bitmap bmp = null;
try {
URL image_value = new URL("http://graph.facebook.com/"+ userId + "/picture?type=large");
bmp = BitmapFactory.decodeStream(image_value.openConnection().getInputStream());
} catch (IOException e) {
Log.e("Error", "image download error");
Log.e("Error", e.getMessage());
e.printStackTrace();
}
return bmp;
}
protected void onPostExecute(Bitmap result) {
bmImage.setImageBitmap(result);
}
}
感谢您提供的所有帮助请尝试使用您的访问令牌在graph api explorer中复制它好吗?如果您可以在那里看到图片,那么这将是代码问题。您可以尝试使用您的访问令牌在graph api explorer中复制它吗?如果你能在那里得到图片,那么这将是代码问题。
final RoundedImageView profilePic = (RoundedImageView) rootView.findViewById(R.id.myProfilePic);
new DownloadImageTask(profilePic).execute(userId);