How to prevent double tap in Android across app?

Ask A Question

Login To post a question

My app is built with around 50-60 screens. Each screen has a button to open a new screen. Now the issue I am facing is when user double tap button, a new screen is open twice.

For this issue, I found a solution like below.

 if (SystemClock.elapsedRealtime() - mLastClickTime < 1000){

            mLastClickTime = SystemClock.elapsedRealtime();

But to prevent double click, I need to write the above code in each button click. I have not created common custom button which used everywhere.

Is there any way to double tap on app level?

For more info please click here

Have a question or need a custom quote?