Code example for ImageView

Methods: getContext

0
 
		@Override 
		public void onImageLoaded(@Nullable final Bitmap image) {
			final ImageView imageView = imageViewRef.get();
			if (imageView != null) {
				final Activity activity = (Activity) imageView.getContext();
				Threads.tryRunOnUiThread(activity, new Runnable() {
					@Override 
					public void run() { 
						if (image != null) {
							imageView.setImageBitmap(image);
						} else { 
							if (defaultImageId != null) {
								imageView.setImageResource(defaultImageId);
							} 
						} 
					} 
				}); 
			} 
		}