Create a method outside from onCreate
method like
View.OnClickListener onClickListener= new View.OnClickListener() {
public void onClick(View v) {
// it was the 1st button
}
};
and in oncreate
method bind that method or click event like this
android_rooting.setOnClickListener(onClickListener);
android_what.setOnClickListener(onClickListener);
android_why.setOnClickListener(onClickListener);
android_how.setOnClickListener(onClickListener);
You also can do this from XML, add android:onClick="onClickListener"
to all your ImageButtons which you want to bind onClickListener
event.Listener.