I\'d like to create a slide button (= something as switch ) with two states: on and off so user will have to press the button and slide it to change the state (something sim
//in your layout design the below line
// 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
