Android中登录界面的记住密码功能实现,将用户输入的账号和密码以SharedPreferences方式存储(注意的是,密码要用MD5明文加密)。
界面xml文件:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >
<EditText
android:id="@+id/et_qq"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="请输入您的qq号码" />
<EditText
android:inputType="textPassword"
android:id="@+id/et_password"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/et_qq"
android:hint="请输入密码" />
<CheckBox
android:id="@+id/cb_remeber_pwd"
android:layout_width="fill_p