I have an imageview and i set Image Resources programmatically like this:
int resourceId = getResources().getIdentifier(\"imagename\", \"drawable\", \"mypack
There are different ways to make view blur in android, But i found the easiest and fastest way to make views blur using Fresco library.
Add following dependency inside your build.gradle of your module.
compile 'jp.wasabeef:fresco-processors:2.1.0'
And inside onCreate() of Activity.
Fresco.initialize(this);
setContentView(R.layout.activity_main);
SimpleDraweeView simpleDraweeView = (SimpleDraweeView) findViewById(R.id.sdv_image);
//INSTANTIATE BLUR POST PROCESSOR
Postprocessor postprocessor = new BlurPostprocessor(this, BLUR_PRECENTAGE);
//INSTATNTING IMAGE REQUEST USING POST PROCESSOR AS PARAMETER
ImageRequest imageRequest = ImageRequestBuilder.newBuilderWithSource(Uri.parse(IMAGE_URL))
.setPostprocessor(postprocessor)
.build();
//INSTANTATE CONTROLLOR()
PipelineDraweeController controller = (PipelineDraweeController) Fresco.newDraweeControllerBuilder()
.setImageRequest(imageRequest)
.setOldController(simpleDraweeView.getController())
.build();
//LOAD BLURRED IMAGE ON SimpleDraweeView(VIEW)
simpleDraweeView.setController(controller);
If you need complete implementation please visit this blog Fastest Image Blur in Android Using Fresco.