Repeat doing something with push button in Android

39 views Asked by At

I wnat to do something after pressing button in android But i want automaticlly it run. do I use while() and sleep() in onClick() ?????? or use handler?

private Button b_get;
 b_get = (Button)findViewById(R.id.get);

        b_get.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {

           // do something several times after 20 Seconds

                }
            }
        });
0

There are 0 answers