gpt4 book ai didi

java - 如何在我的应用程序的登录页面中使用忘记密码

转载 作者:行者123 更新时间:2023-12-01 14:48:33 26 4
gpt4 key购买 nike

我正在关注本教程 http://www.linuxforu.com/2010/12/android-application-development-playing-with-sqlite-database/对于在我的 Android 应用程序中使用登录页面,在本教程中没有关于忘记密码的解释,我想也在我的应用程序中添加这些功能。MYLogin.java

public class UserLoggedInPage extends Activity {

/* (non-Javadoc)
* @see android.app.Activity#onCreate(android.os.Bundle)
*/
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.loggedin);
}

/* (non-Javadoc)
* @see android.app.Activity#onBackPressed()
*/
@Override
public void onBackPressed() {
super.onBackPressed();
Intent i = new Intent(UserLoggedInPage.this, DatabaseActivity.class);
startActivity(i);
finish();
}

xml文件

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/background"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/title"
android:gravity="center"
android:textSize="20sp"
android:textColor="#000000"
/>

<TableLayout
android:id="@+id/layout1"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:padding="30dp"
>
<TableRow
android:id="@+id/row1"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
>
<TextView
android:id="@+id/txtUsername"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/txtUname"
android:padding="10dp"
android:textColor="#000000"
></TextView>

<EditText
android:id="@+id/editUsername"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_weight="0.5"
android:padding="10dp"
style="@android:style/Widget.EditText"
android:textColor="#000000"
>
</EditText>
</TableRow>
<TableRow
android:id="@+id/row2"
>
<TextView
android:id="@+id/txtPassword"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/txtPassword"
android:padding="10dp"
android:textColor="#000000"
></TextView>

<EditText
android:id="@+id/editPassword"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_weight="0.5"
android:padding="10dp"
style="@android:style/Widget.EditText"
android:password="true"
android:textColor="#000000"
></EditText>
</TableRow>
<TableRow
android:id="@+id/row3"
android:layout_gravity="center"
>
<Button
android:id="@+id/buttonLogin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/buttonLogin"
android:layout_gravity="center"
android:layout_weight="1"
></Button>
<Button
android:id="@+id/buttonNewUser"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/buttonSignUp"
android:layout_gravity="center"
android:layout_weight="1"
></Button>
</TableRow>
<TableRow
android:id="@+id/row3"
android:layout_gravity="center"
>
<Button
android:id="@+id/buttonShowAll"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/buttonShowAll"
android:layout_gravity="center"
android:layout_weight="1"
></Button>
</TableRow>
</TableLayout>
</LinearLayout>

****Can anyone tell,how to use forgot password in my application,or give some links or tutorial to learn how to put forgot password in android,i am new to android****

最佳答案

您可以添加额外的链接/按钮作为“忘记密码”。单击此按钮后,创建新 Activity ,您在其中提供一个编辑文本,他可以在其中插入用户名并检查按钮以检查该用户名是否存在于您的数据库中。

检查用户提供的用户名,进行比较,显示结果。

关于java - 如何在我的应用程序的登录页面中使用忘记密码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15131615/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com