mardi 28 avril 2020

android :How to change color of text of counter app after ( 33,66,99,elc ) clicks?

How to change counter when is 33,66,99,elc ??

the project is here on githup https://github.com/hamza94max/Counter

any one can help me ?


public class MainActivity extends AppCompatActivity {
    TextView textView;
    private int counter = 0;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        textView=findViewById(R.id.countertext);
        reset=findViewById(R.id.reset);
        RelativeLayout relativeLayout=findViewById(R.id.reltivee);



        relativeLayout.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                counter++;


                    textView.setText(Integer.toString(counter));
                    textView.setTextColor(Color.BLACK);


                }
        });


    }}

Aucun commentaire:

Enregistrer un commentaire