Code example for ImageView

Methods: getResources

     *            image should be cached locally. 
    private static void setUrlDrawable(final Context context, final ImageView imageView, final String url, final int defaultResource, final long cacheDurationMs) {
        Drawable d = null;
        if (defaultResource != 0) {
            d = imageView.getResources().getDrawable(defaultResource);
        setUrlDrawable(context, imageView, url, d, cacheDurationMs, null);
     * Download and shrink an Image located at a specified URL, and display it 
     * in the provided {@link ImageView}. 
     * @param imageView The {@link ImageView} to display the image to after it 
     *            is loaded. 
     * @param url The URL of the image that should be loaded. 
     * @param defaultResource The Android resid of the {@link Drawable} that 
     *            should be displayed while the image is being downloaded. 
     * @param callback An instance of {@link UrlImageViewCallback} that is 
Experience pair programming with AI  Get Codota for Java