을 "상속 된 추상 메소드 View.OnClickListener.onClick (보기)를 구현해야하는 타입 OnDemandAndAutomatic_Activity"나는이 방법을 구현했습니다에도 불구하고 조상에 의해 부인 될 것으로 보인다 두 곳 ("Quick Fix"를 통해 두 곳 모두에 배치 됨).
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class OnDemandAndAutomatic_Activity extends Activity implements View.OnClickListener {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.ondemandandautomatic_activity);
// try commenting the button code out to see if that lets it run...
Button buttonAuthorizeUsers = (Button) findViewById(R.id.buttonAuthorizeUsers);
buttonAuthorizeUsers.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Intent configure = new Intent(OnDemandAndAutomatic_Activity.this, Configure_Activity.class);
OnDemandAndAutomatic_Activity.this.startActivity(configure);
}});
}
/* @Override
public void onClick(View v) {
// TODO Auto-generated method stub
Intent configure = new Intent(OnDemandAndAutomatic_Activity.this, Configure_Activity.class);
OnDemandAndAutomatic_Activity.this.startActivity(configure);
}*/
}
"독립 실행 형"onClick()을 유지하고 코드를 "buttonAuthorizeUsers.setOnClickListener (this);"로 변경하면 양식의 위젯이 표시되지 않습니다. 만약 내가 그 라인을 주석 처리한다면, 그들은 버튼을 클릭해도 아무런 변화가 없다. (catch 22) –
@ClayShannon :'ondemandandautomatic_activity.xml' 레이아웃에'buttonAuthorizeUsers'' 버튼이 있는지 확인하십시오. 의지. 내가 생각할 수있는 유일한 상황은'buttonAuthorizeUsers'가 존재하지 않기 때문에 당신이'NullPointerException'을 얻고 있다면 당신이 묘사하는 증상을 가질 것입니다. 그것에 대해 알려주지 않고 오류를 먹는 일종의 전역 예외 처리기가 없다면 "강제 닫기"대화 상자가 발생합니다. – CommonsWare