本文整理匯總了Java中com.facebook.internal.ImageResponse.getError方法的典型用法代碼示例。如果您正苦於以下問題:Java ImageResponse.getError方法的具體用法?Java ImageResponse.getError怎麽用?Java ImageResponse.getError使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.facebook.internal.ImageResponse
的用法示例。
在下文中一共展示了ImageResponse.getError方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: processImageResponse
import com.facebook.internal.ImageResponse; //導入方法依賴的package包/類
private void processImageResponse(ImageResponse response, String graphObjectId, ImageView imageView) {
pendingRequests.remove(graphObjectId);
if (response.getError() != null) {
callOnErrorListener(response.getError());
}
if (imageView == null) {
// This was a pre-fetch request.
if (response.getBitmap() != null) {
// Is the cache too big?
if (prefetchedPictureCache.size() >= MAX_PREFETCHED_PICTURES) {
// Find the oldest one and remove it.
String oldestId = prefetchedProfilePictureIds.remove(0);
prefetchedPictureCache.remove(oldestId);
}
prefetchedPictureCache.put(graphObjectId, response);
}
} else if (graphObjectId.equals(imageView.getTag())) {
Exception error = response.getError();
Bitmap bitmap = response.getBitmap();
if (error == null && bitmap != null) {
imageView.setImageBitmap(bitmap);
imageView.setTag(response.getRequest().getImageUri());
}
}
}
示例2: processResponse
import com.facebook.internal.ImageResponse; //導入方法依賴的package包/類
private void processResponse(ImageResponse response) {
// First check if the response is for the right request. We may have:
// 1. Sent a new request, thus super-ceding this one.
// 2. Detached this view, in which case the response should be discarded.
if (response.getRequest() == lastRequest) {
lastRequest = null;
Bitmap responseImage = response.getBitmap();
Exception error = response.getError();
if (error != null) {
OnErrorListener listener = onErrorListener;
if (listener != null) {
listener.onError(new FacebookException(
"Error in downloading profile picture for profileId: " + getProfileId(), error));
} else {
Logger.log(LoggingBehavior.REQUESTS, Log.ERROR, TAG, error.toString());
}
} else if (responseImage != null) {
setImageBitmap(responseImage);
if (response.isCachedRedirect()) {
sendImageRequest(false);
}
}
}
}
示例3: processImageResponse
import com.facebook.internal.ImageResponse; //導入方法依賴的package包/類
private void processImageResponse(ImageResponse paramImageResponse, String paramString, ImageView paramImageView)
{
this.pendingRequests.remove(paramString);
if (paramImageResponse.getError() != null)
callOnErrorListener(paramImageResponse.getError());
if (paramImageView == null)
{
if (paramImageResponse.getBitmap() != null)
{
if (this.prefetchedPictureCache.size() >= 20)
{
String str = (String)this.prefetchedProfilePictureIds.remove(0);
this.prefetchedPictureCache.remove(str);
}
this.prefetchedPictureCache.put(paramString, paramImageResponse);
}
}
else if (paramString.equals(paramImageView.getTag()))
{
Exception localException = paramImageResponse.getError();
Bitmap localBitmap = paramImageResponse.getBitmap();
if ((localException == null) && (localBitmap != null))
{
paramImageView.setImageBitmap(localBitmap);
paramImageView.setTag(paramImageResponse.getRequest().getImageUri());
}
}
}
示例4: processResponse
import com.facebook.internal.ImageResponse; //導入方法依賴的package包/類
private void processResponse(ImageResponse response)
{
// First check if the response is for the right request. We may have:
// 1. Sent a new request, thus super-ceding this one.
// 2. Detached this view, in which case the response should be
// discarded.
if (response.getRequest() == lastRequest)
{
lastRequest = null;
Bitmap responseImage = response.getBitmap();
Exception error = response.getError();
if (error != null)
{
OnErrorListener listener = onErrorListener;
if (listener != null)
{
listener.onError(new FacebookException( "Error in downloading profile picture for profileId: "
+ getProfileId(),
error));
}
else
{
Logger.log(LoggingBehavior.REQUESTS,
Log.ERROR, TAG, error.toString());
}
}
else if (responseImage != null)
{
if (m_OnImageChangedEventListener != null)
{
responseImage =
m_OnImageChangedEventListener
.onImageChangedEventListener(responseImage);
}
setImageBitmap(responseImage);
if (response.isCachedRedirect())
{
sendImageRequest(false);
}
}
}
}