いくつかのボタンに画像を表示し、残りのボタンをクリックすると非表示にする必要がある次の方法があります。他の v.getId() が何であれ、非表示にしたいのです。
public void onClick(View v)
{
if(v.getId() == R.id.d){
imgD.setVisibility(View.VISIBLE);
}else if(v.getId() == R.id.i){
imgI.setVisibility(View.VISIBLE);
}else if(v.getId() == R.id.l){
imgL.setVisibility(View.VISIBLE);
}else{
//if other buttons are clicked then the button must be invisible.
}
}