Nine-grid password lock entry program

Nine-grid password lock entry program

Source code introduction

Set the nine-grid password lock to enter the program, set, reset, cancel, etc. Android Bus Address http://www.apkbus.com/forum.php?mod=viewthread&tid=182620&extra=
Source code running screenshot

Source code snippet

  1. package com.example.demo;
  2.   
  3. import com.example.demo.LocusPassWordView.OnCompleteListener;
  4.   
  5. import android.app.Activity;
  6. import android.content.Intent;
  7. import android.os.Bundle;
  8. import android.os.Handler;
  9. import android.view.View;
  10. import android.widget.TextView;
  11. import android.widget.Toast;
  12.   
  13. public   class LoginActivity extends Activity {
  14.   
  15. private LocusPassWordView lpwv;
  16. private   static   final   int SPLASH_SHOW_TIME = 2000 ;
  17. Handler handler = new Handler();
  18. Intent intent = new Intent();
  19.   
  20. TextView title;
  21.   
  22. @Override  
  23. public   void onCreate(Bundle savedInstanceState) {
  24. super .onCreate(savedInstanceState);
  25. setContentView(R.layout.activity_login);
  26.   
  27. title = (TextView) findViewById(R.id.login_toast);
  28. lpwv = (LocusPassWordView) this .findViewById(R.id.mLocusPassWordView);
  29.   
  30. if (lpwv.isPasswordEmpty()) {
  31. title.setVisibility(View.GONE);
  32. lpwv.setVisibility(View.GONE);
  33.               
  34. handler.postDelayed( new Runnable() {
  35. @Override  
  36. public   void run() {
  37. intent.setClass(getApplicationContext(), MainActivity. class );
  38. startActivity(intent);
  39. finish();
  40. }
  41. }, SPLASH_SHOW_TIME);
  42. } else {
  43. lpwv.setVisibility(View.VISIBLE);
  44. lpwv.setOnCompleteListener( new OnCompleteListener() {
  45. @Override  
  46. public   void onComplete(String mPassword) {
  47. // If the password is correct, enter the main page.  
  48. if (lpwv.verifyPassword(mPassword)) {
  49. Toast.makeText(LoginActivity. this , "Login successful!" ,
  50. Toast.LENGTH_SHORT).show();
  51. intent.setClass(getApplicationContext(),
  52. MainActivity.class );
  53. startActivity(intent);
  54. finish();
  55. } else {
  56. Toast.makeText(LoginActivity. this , "Wrong password, please re-enter" ,
  57. Toast.LENGTH_SHORT).show();
  58. lpwv.clearPassword();
  59. }
  60. }
  61. });
  62. }
  63. }
  64. }

Source code download: http://download..com/data/1978597

<<:  NFC interface adaptation, reading and writing tags (Note and Galaxy series)

>>:  Global annotation and graffiti

Recommend

iQiyi's patch ads display format and charging standards

In the field of mobile online video, iQiyi, Tence...

To be honest, before becoming pets, guinea pigs were actually food...

Many zoos and farms in Japan have a program calle...

How do communities with millions of members operate?

Since 2016, countless knowledge payment platforms...

Get these six points right, attracting seed users won’t be a problem (Part 1)

Probably, the first and most important operationa...

APP promotion: How to attract a large amount of free traffic?

If marketing were a science, I would rather be a ...

Let’s talk about user churn analysis in the simplest way

Churn analysis is not about analyzing the problem...

In 2019, 60% of advertisers' budgets were given to self-media!

Today, Weibo released its latest annual self-medi...