Verification code countdown

Verification code countdown


Source code introduction

Verification code related: 1. Countdown of the button that sends the SMS verification code 2. Parallel monitoring of the button 3. After finish, the background thread still counts down [Note:] This source code is completely different from Zihao’s previous mechanism, so it is not a duplicate code and you can download it with confidence!
Source code screenshot

Source code snippet:

  1. public   class TestMainActivity extends Activity implements OnClickListener {
  2.   
  3. private MyCodeButton v;
  4.   
  5. @Override  
  6. protected   void onCreate(Bundle savedInstanceState) {
  7. super .onCreate(savedInstanceState);
  8. setContentView(R.layout.activity_main);
  9. v = (MyCodeButton) findViewById(R.id.button1);
  10. v.onCreate(savedInstanceState);
  11. v.setTextAfter( "retrieve after s" ).setTextBefore( "get verification code" ).setLenght( 60 * 1000 );
  12. v.setOnClickListener( this );
  13. }
  14.   
  15. @Override  
  16. public   void onClick(View v) {
  17. // TODO Auto-generated method stub  
  18. Toast.makeText(TestMainActivity. this , "Process click events in parallel..." ,
  19. Toast.LENGTH_SHORT).show();
  20. }
  21.   
  22. @Override  
  23. protected   void onDestroy() {
  24. // TODO Auto-generated method stub  
  25. v.onDestroy();
  26. super .onDestroy();
  27. }
  28. }

Source code link: http://download..com/upload

<<:  Android source code warehouse management

>>:  Automatically fill in the SMS verification code received

Recommend

7 Common Marketing Methods Marketers Must Know (I)

Every year there are many good marketing cases . ...

Facebook releases React Native for Android

[[149937]] Facebook today released React Native f...

5 Top Traffic Video Marketing and YouTube Video Production Tutorials

For many foreign trade people, video marketing is...

Frequent early awakening may be a disease. What time is considered "early"?

Have you ever had this experience: you woke up be...

Peipei's Dad "Pepei's Dad's Thinking Forum"

Peipei Dad's "Pepei Dad's Thinking F...

User packaging skills: How to become popular on Douyin?

Today, I will take Douyin as an example to talk a...

Xiaohongshu Product Analysis

Go to Xiaohongshu to see which brand is better&qu...

How to master word-of-mouth marketing? Do these things well!

Word of mouth, one of the oldest forms of communi...