Implement iPhone-like screen lock and apple-like screen lock

Source: Internet
Author: User

Implement iPhone-like screen lock and apple-like screen lock


 

Public class LockActivity extends Activity {@ Overrideprotected void onCreate (Bundle savedInstanceState) {// TODO Auto-generated method stubsuper. onCreate (savedInstanceState); setContentView (R. layout. lockscreen); initUI ();} public EditText editText, editText2, editText3, editText4; private void initUI () {editText = (EditText) findViewById (R. id. editText1); editText2 = (EditText) findViewById (R. id. editText2); ed ItText3 = (EditText) findViewById (R. id. editText3); editText4 = (EditText) findViewById (R. id. editText4); editText. addTextChangedListener (new TextWatcher () {@ Overridepublic void onTextChanged (CharSequence s, int start, int before, int count) {// TODO Auto-generated method stub} @ Overridepublic void beforeTextChanged (CharSequence s, int start, int count, int after) {// TODO Auto-generated method stub} @ Ov Erridepublic void afterTextChanged (Editable s) {// TODO Auto-generated method stubString resString = editText. getText (). toString (). trim (); if (resString! = Null & resString. length ()> 0) {editText2.requestFocus () ;}}); editText2.addTextChangedListener (new TextWatcher () {@ Overridepublic void onTextChanged (CharSequence s, int start, int before, int count) {// TODO Auto-generated method stub} @ Overridepublic void beforeTextChanged (CharSequence s, int start, int count, int after) {// TODO Auto-generated method stub} @ Overridepublic void afterTextChanged (Edita Ble s) {// TODO Auto-generated method stubString resString = editText2.getText (). toString (). trim (); if (resString! = Null & resString. length ()> 0) {editText3.requestFocus () ;}}); editText3.addTextChangedListener (new TextWatcher () {@ Overridepublic void onTextChanged (CharSequence s, int start, int before, int count) {// TODO Auto-generated method stub} @ Overridepublic void beforeTextChanged (CharSequence s, int start, int count, int after) {// TODO Auto-generated method stub} @ Overridepublic void afterTextChanged (Edita Ble s) {// TODO Auto-generated method stubString resString = editText3.getText (). toString (). trim (); if (resString! = Null & resString. length ()> 0) {editText4.requestFocus () ;}}); editText4.addTextChangedListener (new TextWatcher () {@ Overridepublic void onTextChanged (CharSequence s, int start, int before, int count) {// TODO Auto-generated method stub} @ Overridepublic void beforeTextChanged (CharSequence s, int start, int count, int after) {// TODO Auto-generated method stub} @ Overridepublic void afterTextChanged (Edita Ble s) {// TODO Auto-generated method stubString resString = editText4.getText (). toString (). trim (); if (resString! = Null & resString. length ()> 0) {// hide the keyboard InputMethodManager imm = (InputMethodManager) getSystemService (Context. INPUT_METHOD_SERVICE); imm. hideSoftInputFromWindow (editText4.getWindowToken (), 0); // forcibly hide the keyboard }}});}}

The layout is as follows:

<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:layout_width="match_parent"    android:layout_height="match_parent"    android:gravity="center_vertical" >    <LinearLayout        android:layout_width="match_parent"        android:layout_height="wrap_content"         android:orientation="horizontal"        android:paddingRight="20dp">        <EditText        android:id="@+id/editText1"        android:layout_width="fill_parent"        android:layout_weight="1"        android:layout_marginLeft="20dp"                android:layout_height="wrap_content"       android:singleLine="true"        android:ems="1"        android:inputType="textPassword" >    </EditText>    <EditText        android:id="@+id/editText2"         android:layout_width="fill_parent"        android:layout_weight="1"        android:layout_marginLeft="20dp"        android:layout_height="wrap_content"       android:singleLine="true"        android:ems="1"        android:inputType="textPassword" >    </EditText>    <EditText        android:id="@+id/editText3"        android:layout_width="fill_parent"        android:layout_weight="1"        android:layout_marginLeft="20dp"        android:layout_height="wrap_content"        android:singleLine="true"        android:ems="1"        android:inputType="textPassword" >    </EditText>    <EditText        android:id="@+id/editText4"        android:layout_width="fill_parent"        android:layout_weight="1"        android:layout_marginLeft="20dp"        android:layout_height="wrap_content"       android:singleLine="true"        android:ems="1"        android:inputType="textPassword" >    </EditText>    </LinearLayout></RelativeLayout>



 


My mobile phone number is s910w. I have a screen lock software similar to Apple, which is very powerful and has a friendly interface,

This is the case unless you modify the registry.

How to lock a 4S cell phone with a high imitation Apple

High imitation. The battery cannot be locked. Such a simple problem... What is electromechanical integration. Now there's nothing like a high imitation bunker. Okay, if you win and find a black cloth to block the screen, you can't see it.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.