最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

android實(shí)現(xiàn)注冊(cè)登錄程序

 更新時(shí)間:2022年04月24日 10:54:43   作者:被遺忘的秋天  
這篇文章主要為大家詳細(xì)介紹了android實(shí)現(xiàn)注冊(cè)登錄程序,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下

本文實(shí)例為大家分享了android實(shí)現(xiàn)注冊(cè)登錄程序的具體代碼,供大家參考,具體內(nèi)容如下

注冊(cè)頁(yè)面:

user_register.xml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
? ? android:layout_width="fill_parent"
? ? android:layout_height="fill_parent"
? ? android:orientation="vertical"
? ? android:background="@drawable/bg_01">"
? ??
? ? ? <TextView?
? ? ? ? android:layout_width="wrap_content"
? ? ? ? android:layout_height="wrap_content"
? ? ? ? android:text="注冊(cè)"
? ? ? ? android:textSize="22dip"
? ? ? ? android:textColor="#FFFFFF"
? ? ? ? android:paddingLeft="140dip"
? ? ? ? android:paddingRight="50dip"
? ? ? ? android:paddingTop="10dip"
? ? ? ? android:background="@drawable/topbg"
? ? ? ? />
? ? "
? ? <EditText?
? ? ? ? android:id="@+id/register_username"
? ? ? ? android:layout_width="wrap_content"
? ? ? ? android:layout_height="wrap_content"
? ? ? ? android:layout_marginTop="20dip"
? ? ? ? android:background="@drawable/search"?
? ? ? ? android:layout_marginLeft="20dip"
? ? ? ? android:layout_marginRight="20dip"
? ? ? ? android:height="40dip"
? ? ? ? android:hint="用戶名"
? ? ? ? />
?
? ? ?<EditText?
? ? ? ? android:id="@+id/register_passwd"
? ? ? ? android:layout_width="wrap_content"
? ? ? ? android:layout_height="wrap_content"
? ? ? ? android:layout_marginTop="20dip"
? ? ? ? android:background="@drawable/search"?
? ? ? ? android:layout_marginLeft="20dip"
? ? ? ? android:layout_marginRight="20dip"
? ? ? ? android:height="40dip"
? ? ? ? android:hint="密碼"
? ? ? ? />
? ??
? ? ? <EditText?
? ? ? ? android:id="@+id/reregister_passwd"
? ? ? ? android:layout_width="wrap_content"
? ? ? ? android:layout_height="wrap_content"
? ? ? ? android:layout_marginTop="20dip"
? ? ? ? android:background="@drawable/search"?
? ? ? ? android:layout_marginLeft="20dip"
? ? ? ? android:layout_marginRight="20dip"
? ? ? ? android:height="40dip"
? ? ? ? android:hint="確認(rèn)密碼"
? ? ? ? />
? ? ? <Button?
? ? ? ? ? android:id="@+id/register_submit"
? ? ? ? ? android:layout_width="wrap_content"
? ? ? ? ? android:layout_height="wrap_content"
? ? ? ? ? android:background="@drawable/topbg"
? ? ? ? ? android:height="40dip"
? ? ? ? ? android:width="70dip"
? ? ? ? ? android:layout_marginTop="60dip"
? ? ? ? ? android:text="確定"
? ? ? ? ? android:textColor="#FFFFFF"
? ? ? ? ? android:textSize="22dip"
? ? ??
? ? ? ? ? />
? ? ?
</LinearLayout>

處理注冊(cè)頁(yè)面的Activity:

package com.example.foreveross.office;
?
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;
?
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.ParseException;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EntityUtils;
?
import com.example.wenandroid.R;
import android.app.Activity;
import android.os.Bundle;
import android.os.StrictMode;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnFocusChangeListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
?
public class UserRegister extends Activity {
?
private EditText register_username;
private EditText register_passwd;
private EditText reregister_passwd;
private Button register_submit;
?? ?@Override
?? ?protected void onCreate(Bundle savedInstanceState) {
?? ??? ?// TODO Auto-generated method stub
?? ??? ?super.onCreate(savedInstanceState);
?? ??? ?StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
?? ??? ?StrictMode.setThreadPolicy(policy);
?? ??? ?setContentView(R.layout.user_register);
?? ??? ?register_username=(EditText)findViewById(R.id.register_username);
?? ??? ?register_passwd=(EditText)findViewById(R.id.register_passwd);
?? ??? ?reregister_passwd=(EditText)findViewById(R.id.reregister_passwd);
?? ??? ?register_submit=(Button)findViewById(R.id.register_submit);
?? ??? ?register_username.setOnFocusChangeListener(new OnFocusChangeListener()
?? ??? ?{
?
?? ??? ??? ?@Override
?? ??? ??? ?public void onFocusChange(View v, boolean hasFocus) {
?? ??? ??? ??? ?// TODO Auto-generated method stub
?? ??? ??? ??? ?if(!hasFocus){
?? ??? ??? ??? ??? ?if(register_username.getText().toString().trim().length()<4){
?? ??? ??? ??? ??? ??? ?Toast.makeText(UserRegister.this, "用戶名不能小于4個(gè)字符", Toast.LENGTH_SHORT).show();
?? ??? ??? ??? ??? ?}
?? ??? ??? ??? ?}
?? ??? ??? ?}
?? ??? ??? ?
?? ??? ?});
?? ??? ?register_passwd.setOnFocusChangeListener(new OnFocusChangeListener()
?? ??? ?{
?
?? ??? ??? ?@Override
?? ??? ??? ?public void onFocusChange(View v, boolean hasFocus) {
?? ??? ??? ??? ?// TODO Auto-generated method stub
?? ??? ??? ??? ?if(!hasFocus){
?? ??? ??? ??? ??? ?if(register_passwd.getText().toString().trim().length()<6){
?? ??? ??? ??? ??? ??? ?Toast.makeText(UserRegister.this, "密碼不能小于8個(gè)字符", Toast.LENGTH_SHORT).show();
?? ??? ??? ??? ??? ?}
?? ??? ??? ??? ?}
?? ??? ??? ?}
?? ??? ??? ?
?? ??? ?});
?? ??? ?reregister_passwd.setOnFocusChangeListener(new OnFocusChangeListener()
?? ??? ?{
?
?? ??? ??? ?@Override
?? ??? ??? ?public void onFocusChange(View v, boolean hasFocus) {
?? ??? ??? ??? ?// TODO Auto-generated method stub
?? ??? ??? ??? ?if(!hasFocus){
?? ??? ??? ??? ??? ?if(!reregister_passwd.getText().toString().trim().equals(register_passwd.getText().toString().trim())){
?? ??? ??? ??? ??? ??? ?Toast.makeText(UserRegister.this, "兩次密碼輸入不一致", Toast.LENGTH_SHORT).show();?
?? ??? ??? ??? ??? ?}
?? ??? ??? ??? ?}
?? ??? ??? ?}
?? ??? ??? ?
?? ??? ?});
?? ??? ?register_submit.setOnClickListener(new OnClickListener(){
?
?? ??? ??? ?@Override
?? ??? ??? ?public void onClick(View v) {
?? ??? ??? ??? ?
?? ??? ??? ??? ?if(!checkEdit()){
?? ??? ??? ??? ??? ?return;
?? ??? ??? ??? ?}
?? ??? ??? ??? ?// TODO Auto-generated method stub
?? ??? ??? ??? ?String httpUrl="http://192.168.1.100:8080/web-test/register.jsp";
?? ??? ??? ??? ?HttpPost httpRequest=new HttpPost(httpUrl);
?? ??? ??? ??? ?List<NameValuePair> params=new ArrayList<NameValuePair>();
?? ??? ??? ??? ?params.add(new BasicNameValuePair("username",register_username.getText().toString().trim()));
?? ??? ??? ??? ?params.add(new BasicNameValuePair("password",register_passwd.getText().toString().trim()));
?? ??? ??? ??? ?HttpEntity httpentity = null;
?? ??? ??? ??? ?try {
?? ??? ??? ??? ??? ?httpentity = new UrlEncodedFormEntity(params,"utf8");
?? ??? ??? ??? ?} catch (UnsupportedEncodingException e) {
?? ??? ??? ??? ??? ?// TODO Auto-generated catch block
?? ??? ??? ??? ??? ?e.printStackTrace();
?? ??? ??? ??? ?}
?? ??? ??? ??? ?httpRequest.setEntity(httpentity);
?? ??? ??? ??? ?HttpClient httpclient=new DefaultHttpClient();
?? ??? ??? ??? ?HttpResponse httpResponse = null;
?? ??? ??? ??? ?try {
?? ??? ??? ??? ??? ?httpResponse = httpclient.execute(httpRequest);
?? ??? ??? ??? ?} catch (ClientProtocolException e) {
?? ??? ??? ??? ??? ?// TODO Auto-generated catch block
?? ??? ??? ??? ??? ?e.printStackTrace();
?? ??? ??? ??? ?} catch (IOException e) {
?? ??? ??? ??? ??? ?// TODO Auto-generated catch block
?? ??? ??? ??? ??? ?e.printStackTrace();
?? ??? ??? ??? ?}
?? ??? ??? ??? ?if(httpResponse.getStatusLine().getStatusCode()==200)
?? ??? ??? ??? ?{
?? ??? ??? ??? ??? ?String strResult = null;
?? ??? ??? ??? ??? ?try {
?? ??? ??? ??? ??? ??? ?strResult = EntityUtils.toString(httpResponse.getEntity());
?? ??? ??? ??? ??? ?} catch (ParseException e) {
?? ??? ??? ??? ??? ??? ?// TODO Auto-generated catch block
?? ??? ??? ??? ??? ??? ?e.printStackTrace();
?? ??? ??? ??? ??? ?} catch (IOException e) {
?? ??? ??? ??? ??? ??? ?// TODO Auto-generated catch block
?? ??? ??? ??? ??? ??? ?e.printStackTrace();
?? ??? ??? ??? ??? ?}
?? ??? ??? ??? ??? ?Toast.makeText(UserRegister.this, strResult, Toast.LENGTH_SHORT).show();
?? ??? ??? ??? ?}
?? ??? ??? ??? ?else
?? ??? ??? ??? ?{
?? ??? ??? ??? ??? ?Toast.makeText(UserRegister.this, "請(qǐng)求錯(cuò)誤", Toast.LENGTH_SHORT).show();
?? ??? ??? ??? ?}
?? ??? ??? ??? ?
?? ??? ??? ?}
?? ??? ??? ?
?? ??? ?});
?? ?}
?? ?
?? ?private boolean checkEdit(){
?? ??? ?if(register_username.getText().toString().trim().equals("")){
?? ??? ??? ?Toast.makeText(UserRegister.this, "用戶名不能為空", Toast.LENGTH_SHORT).show();
?? ??? ?}else if(register_passwd.getText().toString().trim().equals("")){
?? ??? ??? ?Toast.makeText(UserRegister.this, "密碼不能為空", Toast.LENGTH_SHORT).show();
?? ??? ?}else if(!register_passwd.getText().toString().trim().equals(reregister_passwd.getText().toString().trim())){
?? ??? ??? ?Toast.makeText(UserRegister.this, "兩次密碼輸入不一致", Toast.LENGTH_SHORT).show();
?? ??? ?}else{
?? ??? ??? ?return true;
?? ??? ?}
?? ??? ?return false;
?? ?}
?? ?
}

登錄頁(yè)面:

user_login.xml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
? ? android:layout_width="fill_parent"
? ? android:layout_height="fill_parent"
? ? android:orientation="vertical"?
? ? android:background="@drawable/bg_01">
? ??
? ? <TextView?
? ? ? ? android:layout_width="wrap_content"
? ? ? ? android:layout_height="wrap_content"
? ? ? ? android:text="登錄"
? ? ? ? android:textSize="22dip"
? ? ? ? android:textColor="#FFFFFF"
? ? ? ? android:paddingLeft="140dip"
? ? ? ? android:paddingRight="50dip"
? ? ? ? android:paddingTop="10dip"
? ? ? ? android:background="@drawable/topbg"
? ? ? ? />
? ??
? ? <LinearLayout
? ? android:layout_width="fill_parent"
? ? android:layout_height="wrap_content"
? ? android:orientation="vertical" >
? ? ? ??
? ? ? ? <EditText
? ? ? ? android:id="@+id/login_username"
? ? ? ? android:layout_width="fill_parent"
? ? ? ? android:layout_height="40dip"
? ? ? ? android:layout_marginLeft="20dip"
? ? ? ? android:layout_marginRight="20dip"
? ? ? ? android:layout_marginTop="30dip"
? ? ? ? android:hint="用戶名"
? ? ? ? android:paddingTop="10dip"
? ? ? ? android:textSize="18dip"
? ? ? ? android:background="@drawable/search">
? ? ? ? ? ??
? ? ? ? </EditText>
? ? ? ??
? ? ? ? <EditText
? ? ? ? android:id="@+id/login_password"
? ? ? ? android:layout_width="fill_parent"
? ? ? ? android:layout_height="40dip"
? ? ? ? android:layout_marginLeft="20dip"
? ? ? ? android:layout_marginRight="20dip"
? ? ? ? android:layout_marginTop="10dip"
? ? ? ? android:password="true"
? ? ? ? android:paddingTop="10dip"
? ? ? ? android:textSize="18dip"
? ? ? ? android:hint="密碼"
? ? ? ? android:background="@drawable/search">
? ? ? ? ? ??
? ? ? ? </EditText>
? ? </LinearLayout>
?
? ? ?<LinearLayout
? ? android:layout_width="fill_parent"
? ? android:layout_height="wrap_content"
? ? android:layout_gravity="center_horizontal"
? ? android:layout_marginTop="15dip">
?
? ? ? ? ?<CheckBox
? ? ? ? ? ? ?android:id="@+id/cb1"
? ? ? ? ? ? ?android:layout_width="wrap_content"
? ? ? ? ? ? ?android:layout_height="wrap_content"
? ? ? ? ? ? ?android:layout_marginLeft="50dip"
? ? ? ? ? ? ?android:layout_marginRight="30dip"
? ? ? ? ? ? ?android:text="記住密碼"?
? ? ? ? ? ? ?android:button="@drawable/checkbox_icon_no" />"
? ? ? ? ?<CheckBox
? ? ? ? ? ? ?android:id="@+id/cb2"
? ? ? ? ? ? ?android:layout_width="wrap_content"
? ? ? ? ? ? ?android:layout_height="wrap_content"
? ? ? ? ? ? ?android:text="自動(dòng)登錄"?
? ? ? ? ? ? ?android:paddingRight="50dip"
? ? ? ? ? ? ?android:button="@drawable/checkbox_icon_no"/>
? ? ? ? </LinearLayout>
? ? ? ??
? ? ?<LinearLayout
? ? android:layout_width="fill_parent"
? ? android:layout_height="wrap_content"
? ? android:layout_gravity="center_horizontal"
? ? android:layout_marginTop="20dip">
? ? ? ? ?<Button?
? ? ? ? ? ? ?android:id="@+id/user_login_button"
? ? ? ? ? ? ?android:layout_width="wrap_content"
? ? ? ? ? ? ?android:layout_height="wrap_content"
? ? ? ? ? ? ?android:text="登錄"
? ? ? ? ? ? ?android:layout_marginLeft="50dip"
? ? ? ? ? ? ?android:textColor="#F7FBFD"
? ? ? ? ? ? ?android:background="#FF0000"
? ? ? ? ? ? ?android:width="70dip"
? ? ? ? ? ? ?android:height="40dip"
? ? ? ? ? ? ?android:textSize="18dip"
? ? ? ? ? ? ?/>
? ? ? ? ?
? ? ? ? ? ? <Button?
? ? ? ? ? ? ?android:id="@+id/user_register_button"
? ? ? ? ? ? ?android:layout_width="wrap_content"
? ? ? ? ? ? ?android:layout_height="wrap_content"
? ? ? ? ? ? ?android:text="注冊(cè)"
? ? ? ? ? ? ?android:layout_marginLeft="50dip"
? ? ? ? ? ? ?android:textColor="#F7FBFD"
? ? ? ? ? ? ?android:width="70dip"
? ? ? ? ? ? ?android:height="40dip"
? ? ? ? ? ? ?android:background="#0F9000"
? ? ? ? ? ? ?android:textSize="18dip"
? ? ? ? ? ? ?/>
? ? ? ? ?
? ? ?</LinearLayout>
? ? ?
</LinearLayout>

登錄頁(yè)面Activity:

package com.example.foreveross.office;
?
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;
?
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.ParseException;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EntityUtils;
?
import com.example.wenandroid.R;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.StrictMode;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnFocusChangeListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
?
public class UserLogin extends Activity implements OnClickListener {
private EditText login_username;
private EditText login_password;
private Button user_login_button;
private Button user_register_button;
?
?? ?@Override
protected void onCreate(Bundle savedInstanceState) {
?? ?super.onCreate(savedInstanceState);
?? ?StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
?? ?StrictMode.setThreadPolicy(policy);
?? ?setContentView(R.layout.user_login);
?? ?initWidget();
?
}
?? ?private void initWidget()
?? ?{
?? ??? ?login_username=(EditText)findViewById(R.id.login_username);
?? ??? ?login_password=(EditText)findViewById(R.id.login_password);
?? ??? ?user_login_button=(Button)findViewById(R.id.user_login_button);
?? ??? ?user_register_button=(Button)findViewById(R.id.user_register_button);
?? ??? ?user_login_button.setOnClickListener(this);
?? ??? ?user_register_button.setOnClickListener(this);
?? ??? ?login_username.setOnFocusChangeListener(new OnFocusChangeListener()
?? ??? ?{
?
?? ??? ??? ?@Override
?? ??? ??? ?public void onFocusChange(View v, boolean hasFocus) {
?? ??? ??? ??? ?// TODO Auto-generated method stub
?? ??? ??? ??? ?if(!hasFocus){
?? ??? ??? ??? ??? ?String username=login_username.getText().toString().trim();
?? ??? ??? ??? ??? ?if(username.length()<4){
?? ??? ??? ??? ??? ??? ?Toast.makeText(UserLogin.this, "用戶名不能小于4個(gè)字符", Toast.LENGTH_SHORT);
?? ??? ??? ??? ??? ?}
?? ??? ??? ??? ?}
?? ??? ??? ?}
?? ??? ??? ?
?? ??? ?});
?? ??? ?login_password.setOnFocusChangeListener(new OnFocusChangeListener()
?? ??? ?{
?
?? ??? ??? ?@Override
?? ??? ??? ?public void onFocusChange(View v, boolean hasFocus) {
?? ??? ??? ??? ?// TODO Auto-generated method stub
?? ??? ??? ??? ?if(!hasFocus){
?? ??? ??? ??? ??? ?String password=login_password.getText().toString().trim();
?? ??? ??? ??? ??? ?if(password.length()<4){
?? ??? ??? ??? ??? ??? ?Toast.makeText(UserLogin.this, "密碼不能小于4個(gè)字符", Toast.LENGTH_SHORT);
?? ??? ??? ??? ??? ?}
?? ??? ??? ??? ?}
?? ??? ??? ?}
?? ??? ??? ?
?? ??? ?});
?? ?}
?? ?
?
?? ?@Override
?? ?public void onClick(View v) {
?? ??? ?// TODO Auto-generated method stub
?? ??? ?switch(v.getId())
?? ??? ?{
?? ??? ?case R.id.user_login_button:
?? ??? ??? ?if(checkEdit())
?? ??? ??? ?{
?? ??? ??? ??? ?login();
?? ??? ??? ?}
?? ??? ??? ?
?? ??? ??? ?break;
?? ??? ?case R.id.user_register_button:
?? ??? ??? ?Intent intent2=new Intent(UserLogin.this,UserRegister.class);
?? ??? ??? ?startActivity(intent2);
?? ??? ??? ?break;
?? ??? ?}
?? ?}
?? ?
?? ?private boolean checkEdit(){
?? ??? ?if(login_username.getText().toString().trim().equals("")){
?? ??? ??? ?Toast.makeText(UserLogin.this, "用戶名不能為空", Toast.LENGTH_SHORT).show();
?? ??? ?}else if(login_password.getText().toString().trim().equals("")){
?? ??? ??? ?Toast.makeText(UserLogin.this, "密碼不能為空", Toast.LENGTH_SHORT).show();
?? ??? ?}else{
?? ??? ??? ?return true;
?? ??? ?}
?? ??? ?return false;
?? ?}
?? ?
?? ?private void login(){
?? ??? ?String httpUrl="http://192.168.1.102:8080/web-test/login.jsp";
?? ??? ?HttpPost httpRequest=new HttpPost(httpUrl);
?? ??? ?List<NameValuePair> params=new ArrayList<NameValuePair>();
?? ??? ?params.add(new BasicNameValuePair("username",login_username.getText().toString().trim()));
?? ??? ?params.add(new BasicNameValuePair("password",login_password.getText().toString().trim()));
?? ??? ?HttpEntity httpentity = null;
?? ??? ?try {
?? ??? ??? ?httpentity = new UrlEncodedFormEntity(params,"utf8");
?? ??? ?} catch (UnsupportedEncodingException e) {
?? ??? ??? ?// TODO Auto-generated catch block
?? ??? ??? ?e.printStackTrace();
?? ??? ?}
?? ??? ?httpRequest.setEntity(httpentity);
?? ??? ?HttpClient httpclient=new DefaultHttpClient();
?? ??? ?HttpResponse httpResponse = null;
?? ??? ?try {
?? ??? ??? ?httpResponse = httpclient.execute(httpRequest);
?? ??? ?} catch (ClientProtocolException e) {
?? ??? ??? ?// TODO Auto-generated catch block
?? ??? ??? ?e.printStackTrace();
?? ??? ?} catch (IOException e) {
?? ??? ??? ?// TODO Auto-generated catch block
?? ??? ??? ?e.printStackTrace();
?? ??? ?}
?? ??? ?if(httpResponse.getStatusLine().getStatusCode()==200)
?? ??? ?{
?? ??? ??? ?String strResult = null;
?? ??? ??? ?try {
?? ??? ??? ??? ?strResult = EntityUtils.toString(httpResponse.getEntity());
?? ??? ??? ?} catch (ParseException e) {
?? ??? ??? ??? ?// TODO Auto-generated catch block
?? ??? ??? ??? ?e.printStackTrace();
?? ??? ??? ?} catch (IOException e) {
?? ??? ??? ??? ?// TODO Auto-generated catch block
?? ??? ??? ??? ?e.printStackTrace();
?? ??? ??? ?}
?? ??? ??? ?Toast.makeText(UserLogin.this, strResult, Toast.LENGTH_SHORT).show();
?? ??? ??? ?Intent intent=new Intent(UserLogin.this,IndexActivity.class);
?? ??? ??? ?startActivity(intent);
?? ??? ?}
?? ??? ?else
?? ??? ?{
?? ??? ??? ?Toast.makeText(UserLogin.this, "登錄失敗!", Toast.LENGTH_SHORT).show();
?? ??? ?}
?? ??? ?
?? ?}
}

登錄成功則跳轉(zhuǎn)到IndexActivity.java

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

  • Android自定義橫向滑動(dòng)菜單的實(shí)現(xiàn)

    Android自定義橫向滑動(dòng)菜單的實(shí)現(xiàn)

    這篇文章主要介紹了Android自定義橫向滑動(dòng)菜單的實(shí)現(xiàn),小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧
    2018-05-05
  • 一些有效的Android啟動(dòng)優(yōu)化策略分享

    一些有效的Android啟動(dòng)優(yōu)化策略分享

    在當(dāng)今激烈競(jìng)爭(zhēng)的移動(dòng)應(yīng)用市場(chǎng),應(yīng)用的啟動(dòng)速度直接影響著用戶的第一印象和滿意度,Android的啟動(dòng)優(yōu)化是開(kāi)發(fā)者必須關(guān)注的關(guān)鍵領(lǐng)域,本文將詳細(xì)介紹一些強(qiáng)大有效的Android啟動(dòng)優(yōu)化策略,幫助你優(yōu)化應(yīng)用的啟動(dòng)過(guò)程,為用戶創(chuàng)造更出色的體驗(yàn),需要的朋友可以參考下
    2023-08-08
  • Android 使用Fragment模仿微信界面的實(shí)例代碼

    Android 使用Fragment模仿微信界面的實(shí)例代碼

    自從Android 3.0中引入fragments 的概念,根據(jù)詞海的翻譯可以譯為:碎片、片段。其目的是為了解決不同屏幕分辯率的動(dòng)態(tài)和靈活UI設(shè)計(jì)。下面通過(guò)本文給大家分享Android 使用Fragment模仿微信界面的實(shí)例代碼,需要的的朋友參考下吧
    2017-07-07
  • Android使用KeyStore對(duì)數(shù)據(jù)進(jìn)行加密的示例代碼

    Android使用KeyStore對(duì)數(shù)據(jù)進(jìn)行加密的示例代碼

    這篇文章主要介紹了Android使用KeyStore對(duì)數(shù)據(jù)進(jìn)行加密的示例代碼,小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧
    2017-01-01
  • Android RecyclerView實(shí)現(xiàn)下拉刷新和上拉加載

    Android RecyclerView實(shí)現(xiàn)下拉刷新和上拉加載

    這篇文章主要介紹了Android RecyclerView實(shí)現(xiàn)下拉刷新和上拉加載的相關(guān)資料,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2016-05-05
  • Android仿微信5實(shí)現(xiàn)滑動(dòng)導(dǎo)航條

    Android仿微信5實(shí)現(xiàn)滑動(dòng)導(dǎo)航條

    這篇文章主要為大家詳細(xì)介紹了Android仿微信5實(shí)現(xiàn)滑動(dòng)導(dǎo)航條,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2016-08-08
  • pp列表之分組ListView詳解

    pp列表之分組ListView詳解

    本篇文章是對(duì)Android中的ListView進(jìn)行了詳細(xì)的分析介紹,需要的朋友參考下
    2013-06-06
  • Android Support Annotations資料整理

    Android Support Annotations資料整理

    這篇文章主要介紹了Android Support Annotations資料整理的相關(guān)資料,需要的朋友可以參考下
    2017-05-05
  • Android編程獲取圖片數(shù)據(jù)的方法詳解

    Android編程獲取圖片數(shù)據(jù)的方法詳解

    這篇文章主要介紹了Android編程獲取圖片數(shù)據(jù)的方法,涉及Android網(wǎng)絡(luò)通信數(shù)據(jù)流傳輸及圖片操作相關(guān)技巧,需要的朋友可以參考下
    2017-07-07
  • Android編程操作手機(jī)通訊錄的方法示例

    Android編程操作手機(jī)通訊錄的方法示例

    這篇文章主要介紹了Android編程操作手機(jī)通訊錄的方法,涉及Android權(quán)限控制及通訊錄讀取等相關(guān)操作技巧,需要的朋友可以參考下
    2017-07-07

最新評(píng)論

时尚| 宁远县| 甘德县| 郯城县| 宁陵县| 麻阳| 巴南区| 教育| 山东省| 池州市| 蓬莱市| 长海县| 大兴区| 庆云县| 宾阳县| 永济市| 五台县| 若尔盖县| 寿光市| 方正县| 武邑县| 锡林浩特市| 鹿泉市| 密云县| 祁门县| 保康县| 台南市| 鄂伦春自治旗| 信丰县| 金坛市| 龙井市| 靖江市| 孟连| 兴安县| 宾阳县| 大埔区| 墨玉县| 通化县| 绥德县| 海南省| 秦安县|