This code for effect on click like ripple. just copy this code and past on click place.

Code ripdr = new android.content.res.ColorStateList(new int[][]{new int[]{}}, new int[]{ Color.GREEN}), new, null);

Can i use this code for different types of click like textview button and etc.

Yes you can use this code anywhere in onclick listener method.