0
How do I make a function always add a double value to another, since onClick() adds only 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);
}
That’s not true. Put your code in so we can take a look.
– Piovezan
Actually I asked the wrong question. What I want is for a function to always add a double value to another. I will edit the question.
– Bandicoot_