How do I make a function always add a double value to another, because onClick () only adds up once.
MainActivity.java:
Button somar = (Button)findViewById(R.id.btn);
TextView txt = (TextView)findViewById(R.id.txt);
double a = 20;
double b = 20;
double c = a + b;
somar.setOnClickListener(
new OnClickListener(){
public void onClick(View p1){
txt.setText(c);
}