Android minitwitter Remember password feature

Source: Internet
Author: User

Minitwitter Remember password function implementation

First of all, before entering this main content to say, the implementation of this function is on the basis of the Twitter landing interface operation, but this time the main task is to remember the function of the password implementation, so the landing interface is not detailed introduction.

For the results of this experiment;

1, Interface Introduction

Layout Construction: The layout is divided into three parts

(1) Background: Use linearlayout layout;

(2) Light blue section: Use relativelayout layout;

Note: Use the fillet setting corners and fill color to set solid;

(3) Input box and button: Use TextView, EditText, button;

The aivity_main.xml code is as follows:        

1<TextView2Android:id= "@+id/login_user_input"3Android:layout_width= "Wrap_content"4android:layout_height= "Wrap_content"5Android:layout_alignparenttop= "true"6android:layout_margintop= "5DP"7android:text= "@string/login_label_username"8style= "@style/normaltext"/>9 Ten<style name= "Normaltext" parent= "@android: Style/textappearance" > One<item name= "Android:textcolor" > #444 </item> A<item name= "Android:textsize" >14sp</item> -</style> -<EditText theAndroid:id= "@+id/username_edit" -Android:layout_width= "Fill_parent" -android:layout_height= "Wrap_content" -android:hint= "@string/login_username_hint" +android:layout_below= "@id/login_user_input" -Android:singleline= "true" +android:inputtype= "Text"/> A<TextView atAndroid:id= "@+id/login_password_input" -Android:layout_width= "Wrap_content" -android:layout_height= "Wrap_content" -android:layout_below= "@id/username_edit" -android:layout_margintop= "3DP" -android:text= "@string/login_label_password" instyle= "@style/normaltext"/> -<EditText toAndroid:id= "@+id/password_edit" +Android:layout_width= "Fill_parent" -android:layout_height= "Wrap_content" theandroid:layout_below= "@id/login_password_input" *Android:password= "true" $Android:singleline= "true"Panax NotoginsengAndroid:inputtype= "Textpassword" -/> the<Button +Android:id= "@+id/signin_button" AAndroid:layout_width= "Wrap_content" theandroid:layout_height= "Wrap_content" +android:layout_below= "@id/password_edit" -android:layout_alignright= "@id/password_edit" $android:text= "@string/login_label_signin" $android:background= "@drawable/blue_button" -/>

2, remember the password function implementation
Reminder: The implementation of this feature mainly uses sharedpreferences to store passwords

The code is as follows:

Android minitwitter Remember password feature

Related Article

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: 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.