MainActivity Class, exit button click event:
 public void onClick(View v) {
    CustomDialog cd = new CustomDialog();
    dialog = new Dialog(this);
    cd.runConfirmationDialog(dialog, R.layout.custommessage,
    R.id.d_tittle, "Exit", R.id.d_text, "Close Application",
    R.id.btn_no, R.id.btn_yes, this);
    }
CustomDialog Class:
public class CustomDialog extends Activity {
void runConfirmationDialog(final Dialog dialog, int customLayoutID,int titleID, String title, int messageID, String message, int buttonCancelID,
        int buttonOkeyID, final CustomDialogMethods main) {
    dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    dialog.setContentView(customLayoutID);
}
void show(){
}
Now, i want create Custom Dialog with runConfirmationDialog methods when application first time run. After i want show Dialog Box with only simple Show Methods in another classes.
Which way to best for it?
Thanks.
 
    