It is necessary that when you click on the Item ListView , the alpha channel value of all other Item 's is set to 0.5 . I tried to implement it through a cycle:
for (int a = 0; a < lv.getChildCount(); a++) { lv.getChildAt(a).setAlpha(0.5f); } But when you click on Item application crashes with the log:
Attempt to invoke virtual method 'void android.view.View.setAlpha(float)' on a null object reference That is: with those Item 's that are not visible on the screen, nothing can be done (there are none).
How then to implement this?