XML로 로그인 양식을 만들었습니다. 내 공유 환경 설정이 작동하지만, 자바 클래스에 전체 화면을 추가하면 응용 프로그램이 다운됩니다. 여기 내 코드가 있는데 도움이된다면 감사 할 것입니다.안드로이드 공유 환경 설정 전체 화면이 작동하지 않습니다.
getWindow().requestFeature(Window.FEATURE_NO_TITLE);
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
/*
* Check if we successfully logged in before.
* If we did, redirect to home page
*/
SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0);
if (settings.getString("logged", "").toString().equals("logged")) {
Intent intent = new Intent(Password.this, Video.class);
startActivity(intent);
}
Button b = (Button) findViewById(R.id.loginbutton);
b.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
EditText username = (EditText) findViewById(R.id.username);
EditText password = (EditText) findViewById(R.id.password);
if(username.getText().toString().length() > 0 && password.getText().toString().length() > 0) {
//------------------------------------Username below -------------------------------------Password below ---//
if(username.getText().toString().equals("username") && password.getText().toString().equals("password")) {
/*
* So login information is correct,
* we will save the Preference data
* and redirect to next class/home
*/
SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0);
SharedPreferences.Editor editor = settings.edit();
editor.putString("logged", "logged");
editor.commit();
Intent intent = new Intent(Password.this, Video.class);
startActivity(intent);
}
}
}
});
}
}
오류 로그 표시 ... –