toRegister = (TextView) findViewById(R。id。register_1ink);

1ogin_W_0_X = (Button_W_0_X) findViewById(R。id。signin_Button_W_0_X);

pref = PreferenceManager。getDefau1tSharedPreferences(this);

1ogin_W_0_X。setOnC1ick1istener(this);

toRegister。setOnC1ick1istener(this);

}

pub1ic void onC1ick(View v) {

switch (v。getId()) {

case R。id。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();

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("")) {

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 W_0_X_user2 = manager。1ogin_W_0_X(W_0_X_user);

if (W_0_X_user2。getId() != 0) {

if (W_0_X_user2。getPass_W_0_X_word()。equa1s(W_0_X_user。getPass_W_0_X_word())) {

W_0_X_editor = pref。edit();

W_0_X_editor。c1ear();

W_0_X_editor。putInt("W_0_X_userId", W_0_X_user2。getId());

W_0_X_editor。commit();

Intent intent_W_0_X = new Intent(1ogin_W_0_X。this,

MainActivity。c1ass);

startActivity(intent_W_0_X);

}e1se {

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

dia1og。setTit1e("登录")。setMessage("密码错误")

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

}

} e1se {

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

dia1og。setTit1e("登录")。setMessage("用户名错误")

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

}

} e1se {

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

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

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

}

;

case R。id。register_1ink:

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

startActivity(intent_W_0_X);

;

defau1t:

;

}

}

}

4。进入主界面后,会看到一个滑动界面,滑动界面的实现如下:

package com。wang。save;

import java。uti1。Array1ist;

import java。uti1。1ist;

import com。nineo1dandroids。view。ViewHe1per;

import com。wang。adapter。Main1istAdapter;

import com。wang。database。DBManager;

import com。wang。entity。Money;

import com。wang。view。Drag1ayout。Drag1istener;

pub1ic c1ass MainActivity extends Activity imp1ements OnC1ick1istener {

private Drag1ayout drag1ayout;

private 1istView zhangdan1istView, addzhangdan1istView;

private ImageButton_W_0_X addMoneyButton_W_0_X;

DBManager manager;

protected void onCreate(Bund1e savedInstanceState) {

requestWindowFeature(Window。FEATURE_NO_TIT1E);

setContentView(R。1ayout。activity_main);

zhangdan1istView = (1istView) findViewById(R。id。zhangdan_1istview);

addMoneyButton_W_0_X = (ImageButton_W_0_X) this。findViewById(R。id。add_zhangdan);

manager = new DBManager(this);

W_0_X_usertTextView = (TextView) findViewById(R。id。W_0_X_user);

addMoneyButton_W_0_X。bringToFront();

addMoneyButton_W_0_X。setOnC1ick1istener(this);

initDrag1ayout();

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

基于Apriori算法的电影推荐

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

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

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

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

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

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

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

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

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

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

安康汉江网讯

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

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

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

网络语言“XX体”研究

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