Please help. I want to add multiple clicks to one button
I read on the site a solution to this problem and I tried it but did not succeed , began to implement the first condition only and ignore the second condition
How can I solve this dilemma?
This is the code you tried
 
Code
Button b1;

int i=0;
 
TypeScript
b1=(Button) findViewById(R.id.btns);

b1.setOnClickListener( new View.OnClickListener() {
    @SuppressLint("WrongConstant")
    @Override
 public void onClick(View view) {

        if(i==0)
        {
            Intent in = new Intent();
            in.putExtra( REG_INT_TAG, quantity1);
            setResult(RESULT_OK,in);
            finish();

        }
        else if(i==1)
        {
            Intent in = new Intent();
            in.putExtra( REG_INT_TAG1, quantity1);
            setResult(RESULT_OK,in);
            finish();
        }
        i++;
    }
} );