대화 상자를 사용 중입니다. 버튼을 클릭하면 다른 액티비티가 호출되기를 원합니다. 그러나 그것은 다음과 같은 오류를 제공합니다. // 생성자의 의도 (새 DialogInterface.OnClickListener() {}이 클래스) 하나의 활동에서 다른 활동 (클래스)을 호출하는 방법은 무엇입니까?
을 정의되지 여기에 코드를 귀하의 경우builder1.setNegativeButton("secondact", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
Intent i=new Intent(this, FbsampleActivity.class)
}
});
당신이 설명 할 수 getBaseContext()를 사용하지 않는 이유는 무엇입니까? – Carnal
이 게시물을 참조하십시오 http://stackoverflow.com/questions/1026973/android-whats-the-difference-between-the-various-methods-to-get-a-context 및이 Google 공식 블로그 http : // android- developers.blogspot.in/2009/01/avoiding-memory-leaks.html –
업데이트하지 않을 경우 컨텍스트의 이전 참조 내용이 포함되어있어 메모리 누수가 발생할 수 있습니다. –