I created the following DialogFragment deriving it from the Android documentation:
public class PayBillDialogFragment extends DialogFragment{
@Ov
To call dialog you can use this:
android.support.v4.app.FragmentManager fm = getSupportFragmentManager();
if (fm.findFragmentByTag("PayBillDialogFragment") == null) {
PayBillDialogFragment payBillDialogFragment = new PayBillDialogFragment();
payBillDialogFragment.show(fm, "PayBillDialogFragment");
}
In your dialogFragment,
setPositiveButton("Paga", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
//Add your code here that should execute
//when positive button is clicked
}
});