//in your layout design the below line
android:layout_height="wrap_content">
// in your activity call this
ImageView mNotification_on_btn=(ImageView)findViewById(R.id.on_btn);
ImageView mNotification_off_btn=(ImageView)findViewById(R.id.off_btn);
mNotification_on_btn.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
mNotification_on_btn.setVisibility(View.GONE);
mNotification_off_btn.setVisibility(View.VISIBLE);
}
});
mNotification_off_btn.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
mNotification_off_btn.setVisibility(View.GONE);
mNotification_on_btn.setVisibility(View.VISIBLE);
}
});
// this will switch like iphone style on off toggle button