나는 모든 활동에 사용자 정의 대화 상자입니다. 두 매개 변수 컨텍스트와 메시지 문자열을 전달하는 일반적인 메소드를 작성하는 방법은 무엇입니까? 제안 사항을 알려주십시오.자바를 사용하여 전체 안드로이드 애플 리케이션을위한 사용자 정의 대화 상자 일반적인 방법을 만드는 방법은?
final Dialog dialog = new Dialog(Activity.this,R.style.DialogTheme);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(R.layout.notify_received_activity);
// set the custom dialog components - text and button
TextView text = (TextView) dialog.findViewById(R.id.txtmsg);
text.setText("Tracking Number : " + mTrackingNR);
Button dialogButton = (Button) dialog.findViewById(R.id.btncancel);
// if button is clicked, close the custom dialog
dialogButton.setOnClickListener(new OnClickListener() {
public void onClick(View v) {dialog.dismiss();} });
dialog.show();