Hii everybody i am new to android & java 

I was trying to make a simple app in which clicking tapb button increments the variable value of notaps & second reset it to 0 but when i click on tapb it increments the value & clicking reset reset it but when i again click tabp it increments from the previous value

Eg :

init value of notaps = 0;

i click tabp 3 times notaps value = 3

i click reset notaps value = 0

i click tabp 3 times notaps value = 4



Button tapb = (Button)findViewById(R.id.tapb);
Button reset = (Button)findViewById(R.id.reset);
int notaps = 0;

tapb.setOnClickListener(
new Button.OnClickListener(){
int notaps = 0;
@Override
public void onClick(View v) {
TextView taps = (TextView)findViewById(R.id.taps);
notaps=notaps+1;
taps.setText(String.valueOf(notaps));

}
}
);

reset.setOnClickListener(
new Button.OnClickListener() {

@Override
public void onClick(View v) {
TextView taps = (TextView) findViewById(R.id.taps);
final int notaps=0;
taps.setText(String.valueOf(notaps));

}
}
);