Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -123,26 +123,6 @@ public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
}
});

login_button = findViewById( R.id.login );

login_button.setOnClickListener( new View.OnClickListener() {
@Override
public void onClick(View view) {
AlertDialog.Builder builder = new AlertDialog.Builder(LoginActivity.this);
builder.setTitle("알림")
.setMessage("서버를 옮기는 중입니다! 지금은 서비스를 이용하실 수 없습니다.🥺")
.setPositiveButton("확인", null)
.create()
.show();
//LoginResponse();
if (ID != null) {
Intent intent = new Intent(LoginActivity.this, PetSelectActivity.class);
startActivity(intent);
LoginActivity.this.finish();
}
}
});

//(TEST) 자동 로그인 체크됨에 따라 저장하기
autoLogin.setOnClickListener(new View.OnClickListener() {
@Override
Expand All @@ -156,6 +136,31 @@ public void onClick(View view) {
}
});

if (ID == null) {
Login();
} else {
Toast.makeText(this, "자동 로그인", Toast.LENGTH_SHORT).show();
Intent intent = new Intent(LoginActivity.this, PetSelectActivity.class);
startActivity(intent);
LoginActivity.this.finish();
}

}

public void Login() {
login_button = findViewById( R.id.login );
login_button.setOnClickListener( new View.OnClickListener() {
@Override
public void onClick(View view) {
AlertDialog.Builder builder = new AlertDialog.Builder(LoginActivity.this);
builder.setTitle("알림")
.setMessage("서버를 옮기는 중입니다! 지금은 서비스를 이용하실 수 없습니다.🥺")
.setPositiveButton("확인", null)
.create()
.show();
LoginResponse();
}
});
}

public void LoginResponse() {
Expand All @@ -181,10 +186,6 @@ public void onResponse(Call<LoginResponse> call, Response<LoginResponse> respons
editor.commit();
Log.d("Token", token);

//자동 로그인 체크됨에 따라 저장하기
if(autoLogin.isChecked()) {
}

if (statusCode==200) {
String userID = login_email.getText().toString();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

package com.mnchatbot.myapplication.ui.setting;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
Expand All @@ -26,7 +27,7 @@
public class ProfileActivity extends SettingActivity {
private Context context;
private TextView ID, pwchange, logout, deleteinfo;
private SharedPreferences preferences;
private SharedPreferences preferences, pre2;

//서버통신
public String getToken() {
Expand Down Expand Up @@ -63,6 +64,11 @@ public void onClick(View view) {
@Override
public void onClick(View view) {
//로그인 화면으로 돌아가기
pre2 = context.getSharedPreferences("autoLogin", Activity.MODE_PRIVATE);
SharedPreferences.Editor editor = pre2.edit();
editor.clear();
editor.commit();

Intent intent = new Intent(getApplicationContext(), LoginActivity.class);
startActivity(intent);
}
Expand Down