I want to create a custom dialog box like below
I have tried the foll
Simplest way to create custom dialog box:
Initialize and show dialog:
ViewDialog alertDialoge = new ViewDialog();
alertDialoge.showDialog(getActivity(), "PUT DIALOG TITLE");
Create method:
public class ViewDialog {
public void showDialog(Activity activity, String msg) {
final Dialog dialog = new Dialog(activity);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setCancelable(false);
dialog.setContentView(R.layout.custom_dialoge_feedback);
TextView text = (TextView) dialog.findViewById(R.id.text_dialog_feedback);
text.setText(msg);
Button okButton = (Button) dialog.findViewById(R.id.btn_dialog_feedback);
Button cancleButton = (Button) dialog.findViewById(R.id.btn_dialog_cancle_feedback);
final EditText edittext_tv = (EditText) dialog.findViewById(R.id.dialoge_alert_text_feedback);
okButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//Perfome Action
}
});
cancleButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
dialog.dismiss();
}
});
dialog.show();
}
}
Create layout XML which you want or need.