안녕하세요.
버튼을 눌렀을때, 다이얼로그 부분에서 인텐트가 동작하도록 하고 싶은데 그 방법을 모르겠습니다..
간단하게 Intent it = new Intent(getContext,Register.class);
startActivity(it); 를 했는데, 그게 아래의 Custom_Dialog2 자바파일에서는 동작하지 않아서
어떻게 해줘야 할지 막막합니다 ㅠ ㅠ
어떻게 해야 아래의 OnClick 부분이 동작하게 될 경우에 Register.class로 이동을 하게 만들어줄수
있을까요 ㅠ ㅠ 며칠째 이것만 하는데 쉽게 해결되지 않네요..
제가 아래와 같이 다이얼로그를 호출을 했습니다.
Custom_Dialog2 Dialog2 = new Custom_Dialog2(Payment.this);
Dialog2.show();
그리고 난 뒤에, Custom_Dialog2는 아래와 같이 구성되어 있습니다.
import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.Button;
public class Custom_Dialog2 extends Dialog implements View.OnClickListener{
Button btn;
public Custom_Dialog2(Context context) {
super(context);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_custom__dialog2);
btn = (Button) findViewById(R.id.Custom_Button2);
btn.setOnClickListener(this);
}
public void onClick(View view) {
if (view.getId() == R.id.Custom_Button2) {
if (isShowing()) {
dismiss();
}
}
}
}