<LinearLayout 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"
android:background="@drawable/helpback"
android:orientation="vertical"
tools:context=".DengLuActivity" >java
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="@string/name"
android:textSize="20sp" />android
<EditText
android:id="@+id/et_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:hint="@string/name_hint" />app
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="@string/password"
android:textSize="20sp" />ide
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >this
<EditText
android:id="@+id/et_password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:hint="@string/password_hint"
android:inputType="textPassword" />xml
<TextView
android:id="@+id/register"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:background="@drawable/ic_launcher" />事件
</RelativeLayout>圖片
<Button
android:id="@+id/bt_denglu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:text="@string/denglu" />utf-8
</LinearLayout>get
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@drawable/b">
</LinearLayout>
package com.jxc.homeandschool;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;
public class LogoActivity extends Activity implements Runnable {
private long startTime;// 圖片開始起始時間
@Override
protected void onCreate(Bundle savedInstanceState) {
requestWindowFeature(Window.FEATURE_NO_TITLE);// 去掉標題欄
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);// 去掉信息欄
super.onCreate(savedInstanceState);
startTime = System.currentTimeMillis();
setContentView(R.layout.logo);
new Thread(this).start();
}
public void run() {
while (System.currentTimeMillis() - startTime < 2000) {
Thread.yield();
}
Intent intent = new Intent(LogoActivity.this, DengLuActivity.class);
startActivity(intent);
finish();
}
}
package com.jxc.homeandschool;
import java.util.Map;
import com.jxc.logic.LoginLogicActivity;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
public class DengLuActivity extends Activity {
private EditText name, password;// 用戶名,密碼
private Button denglu;// 登錄
private TextView register;// 註冊
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_main);
name = (EditText) this.findViewById(R.id.et_name);
password = (EditText) this.findViewById(R.id.et_password);
denglu = (Button) this.findViewById(R.id.bt_denglu);
register = (TextView) this.findViewById(R.id.register);
/**
* 註冊監聽
*/
register.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View arg0) {
Intent intent = new Intent(DengLuActivity.this,
RegeisterActivity.class);
startActivity(intent);
}
});
/**
* 登錄按鈕監聽事件
*/
denglu.setOnClickListener(new View.OnClickListener() {
@Override public void onClick(View arg0) {// LoginLogicActivity login = new LoginLogicActivity();// Map<String, String> map = login.getLogin(name.getText()// .toString(), password.getText().toString());// // if(map==null){// return;// } Intent intent=new Intent(DengLuActivity.this,MainActivity.class); startActivity(intent); } }); }}