Page 380 - MDP2022-2
P. 380
Toast.makeText(LoginActivity.this, "로그인에 실패했습니다.", Toast.LENGTH_SHORT).show();
}
}
});
}
}
else if(autoLoginCheck.isChecked()){
Toast.makeText(getApplicationContext(),autoEmail+"로 자동로그인 하셨습니다.",Toast.LENGTH_SHORT).show();
Intent intent = new Intent(LoginActivity.this, ComActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
startActivity(intent);
}
}
});
Button btn_register = findViewById(R.id.register);
btn_register.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view)
{
Intent intent = new Intent(LoginActivity.this, RegisteActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
startActivity(intent);
}
});
}
int BackConfirm = 0;
@Override
public void onBackPressed() {
if(BackConfirm == 0){
Toast.makeText(this, "한 번 더 누르면 종료됩니다.", Toast.LENGTH_SHORT).show();
}
else if(BackConfirm >= 1) {
Toast.makeText(this, "종료합니다.", Toast.LENGTH_SHORT).show();
finish();
}
BackConfirm++;
}
public void showImage(View view){
if(touch_state == 9) {
Toast.makeText(this, "Ich bin der Meister der Rebellion", Toast.LENGTH_SHORT).show();
Intent intent = new Intent(LoginActivity.this, MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
startActivity(intent);
}
else{
touch_state++;
}
}
}
Login Request -
import com.android.volley.AuthFailureError;
import com.android.volley.Response;
import com.android.volley.toolbox.StringRequest;
import java.util.HashMap;
import java.util.Map;
public class LoginRequest extends StringRequest {
//서버URL 설정(php 파일 연동)
final static private String URL = "http://juhyuk2004.dothome.co.kr/login.php";
private Map<String, String> map;
public LoginRequest(String userID, String userPassword, Response.Listener<String> listener) {
super(Method.POST, URL, listener, null);
map = new HashMap<>();
map.put("userID", userID);
map.put("userPassword", userPassword);
}
@Override
protected Map<String, String>getParams() throws AuthFailureError {
return map;
}
}