|
|
@ -6,8 +6,10 @@ import androidx.appcompat.app.AppCompatActivity;
|
|
|
|
import android.content.Intent;
|
|
|
|
import android.content.Intent;
|
|
|
|
import android.os.Bundle;
|
|
|
|
import android.os.Bundle;
|
|
|
|
import android.os.Handler;
|
|
|
|
import android.os.Handler;
|
|
|
|
|
|
|
|
import android.os.Looper;
|
|
|
|
import android.os.Message;
|
|
|
|
import android.os.Message;
|
|
|
|
import android.view.View;
|
|
|
|
import android.view.View;
|
|
|
|
|
|
|
|
import android.widget.Button;
|
|
|
|
import android.widget.EditText;
|
|
|
|
import android.widget.EditText;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -18,6 +20,7 @@ public class SignInActivity extends AppCompatActivity {
|
|
|
|
public static final int SEND = 0;
|
|
|
|
public static final int SEND = 0;
|
|
|
|
EditText usnm;
|
|
|
|
EditText usnm;
|
|
|
|
EditText pswd;
|
|
|
|
EditText pswd;
|
|
|
|
|
|
|
|
UserService uService;
|
|
|
|
User user;
|
|
|
|
User user;
|
|
|
|
Handler mHandler = new Handler(){
|
|
|
|
Handler mHandler = new Handler(){
|
|
|
|
int flag = -1;
|
|
|
|
int flag = -1;
|
|
|
@ -44,12 +47,14 @@ public class SignInActivity extends AppCompatActivity {
|
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
|
super.onCreate(savedInstanceState);
|
|
|
|
super.onCreate(savedInstanceState);
|
|
|
|
setContentView(R.layout.activity_signin);
|
|
|
|
setContentView(R.layout.activity_signin);
|
|
|
|
|
|
|
|
uService = new UserService();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void user_commit(View view){
|
|
|
|
public void user_commit(View view){
|
|
|
|
usnm = findViewById(R.id.user_name);
|
|
|
|
usnm = findViewById(R.id.user_name);
|
|
|
|
pswd = findViewById(R.id.pass_word);
|
|
|
|
pswd = findViewById(R.id.pass_word);
|
|
|
|
new LoginThread().start();
|
|
|
|
new LoginThread().start();
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void onToRegister(View view){
|
|
|
|
public void onToRegister(View view){
|
|
|
@ -63,7 +68,7 @@ public class SignInActivity extends AppCompatActivity {
|
|
|
|
int flag = -1;
|
|
|
|
int flag = -1;
|
|
|
|
String name = usnm.getText().toString();
|
|
|
|
String name = usnm.getText().toString();
|
|
|
|
String pasd = pswd.getText().toString();
|
|
|
|
String pasd = pswd.getText().toString();
|
|
|
|
UserService uService = new UserService();
|
|
|
|
//UserService uService = new UserService();
|
|
|
|
flag = uService.login(name,pasd);
|
|
|
|
flag = uService.login(name,pasd);
|
|
|
|
Message message = mHandler.obtainMessage();
|
|
|
|
Message message = mHandler.obtainMessage();
|
|
|
|
if(flag==0){
|
|
|
|
if(flag==0){
|
|
|
|