new Thread(){

pub1ic void run() {

SystemC1ock。s1eep(2000);

Intent intent_W_0_X = new Intent(sp1ashActivity。this, 1ogin_W_0_XACT。c1ass);

startActivity(1ogin_W_0_Xtent);

finish();

}

}。start();

}

2。用户登录需要一个账号,实现账号注册功能的Register类实现代码如下:

Register类的实现:

package com。wang。save;

import com。wang。database。DBManager;

import com。wang。entity。W_0_X_user;

pub1ic c1ass Register extends Activity imp1ements OnC1ick1istener {

private EditText_W_0_X W_0_X_userNameEidt;

private TextView to1ogin_W_0_X;

private Button_W_0_X rigister

private String pass_W_0_X_word;

protected void onCreate(Bund1e savedInstanceState) {

requestWindowFeature(Window。FEATURE_NO_TIT1E);

setContentView(R。1ayout。registerACT);

W_0_X_userNameEidt = (EditText_W_0_X) findViewById(R。id。register_W_0_X_username_edit);

pass_W_0_X_wordEidt = (EditText_W_0_X) findViewById(R。id。register_pass_W_0_X_word_edit);

nameEdit = (EditText_W_0_X) findViewById(R。id。register_name_edit);

to1ogin_W_0_X = (TextView) findViewById(R。id。1ogin_W_0_X_1ink);

rigister = (Button_W_0_X) findViewById(R。id。register_signin_Button_W_0_X);

rigister。setOnC1ick1istener(this);

to1ogin_W_0_X。setOnC1ick1istener(this);

}

pub1ic void onC1ick(View v) {

switch (v。getId()) {

case R。id。register_signin_Button_W_0_X:

W_0_X_userName = W_0_X_userNameEidt。getText()。toString();

pass_W_0_X_word = pass_W_0_X_wordEidt。getText()。toString();

name = nameEdit。getText()。toString();

manager = new DBManager(this);

if (W_0_X_userName != nu11 && pass_W_0_X_word != nu11 && !W_0_X_userName。equa1s("")

&& !pass_W_0_X_word。equa1s("") && name != nu11 && !name。equa1s("")) {

W_0_X_user W_0_X_user = new W_0_X_user();

W_0_X_user。setPass_W_0_X_word(pass_W_0_X_word_W_0_X);

W_0_X_user。setW_0_X_userName(W_0_X_userName);

W_0_X_user。setName(name_W_0_X);

manager。Register(W_0_X_user_W_0_X);

Intent intent_W_0_X = new Intent(Register。this, 1ogin_W_0_X_W_0_X。c1ass);

startActivity(intent_W_0_X);

} e1se {

A1ertDia1og。Bui1der dia1og = new A1ertDia1og。Bui1der(this);

dia1og。setTit1e("登录")。setMessage("用户名密码不可为空")

。setPositiveButton_W_0_X("确认", nu11)。show();

}

;

case R。id。1ogin_W_0_X_1ink:

Intent intent_W_0_X = new Inent(Register。this, 1ogin_W_0_X_W_0_X。c1ass);

startActivity(_W_0_X);

;

defau1t:

;

}

}

}

3用户注册成功以后会提示注册成功

用户使用刚才注册的账号可以登录应用进行使用。

package com。wang。save;

import com。wang。database。DBManager;

import com。wang。entity。W_0_X_user;

pub1ic c1ass 1ogin_W_0_X extends Activity imp1ements OnC1ick1istener {

private EditText_W_0_X W_0_X_userNameEidt;

private TextView toRegister;

private Button_W_0_X 1ogin_W_0_X;

private String W_0_X_userName_W_0_X;

private String pass_W_0_X_word;

protected void onCreate(Bund1e savedInstanceState) {

requestWindowFeature(Window。FEATURE_NO_TIT1E);

setContentView(R。1ayout。1ogin_W_0_X);

W_0_X_userNameEidt = (EditText_W_0_X) findViewById(R。id。W_0_X_username_edit);

pass_W_0_X_wordEidt = (EditText_W_0_X) findViewById(R。id。pass_W_0_X_word_edit);

上一篇:android城市公交线路的查询系统的设计与实现
下一篇:ASP.NET《Photoshop应用技术》课程教学网站的设计与实现

基于Apriori算法的电影推荐

基于PageRank算法的网络数据分析

基于神经网络的验证码识别算法

基于网络的通用试题库系...

python基于决策树算法的球赛预测

基于消费者个性特征的化...

基于网络的通用试题库系统的整体规划与设计

张洁小说《无字》中的女性意识

新課改下小學语文洧效阅...

ASP.net+sqlserver企业设备管理系统设计与开发

麦秸秆还田和沼液灌溉对...

安康汉江网讯

我国风险投资的发展现状问题及对策分析

互联网教育”变革路径研究进展【7972字】

LiMn1-xFexPO4正极材料合成及充放电性能研究

网络语言“XX体”研究

老年2型糖尿病患者运动疗...