I need to put an EditText to fill in the name ... that is when the user clicks the button will appear an AlertDialog, which should put the name of the player, I made a step, here in SOpt has a question of this type only unable to resolve.
Could anyone help me?
Code:
package com.gif.popupsair;
import android.app.Dialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.DialogFragment;
import android.support.v7.app.AlertDialog;
public class MyCaixa extends DialogFragment{
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
AlertDialog.Builder builderr = new AlertDialog.Builder(getActivity());
builderr.setMessage("Nome do jogador")
.setPositiveButton("Salvar", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
}).setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
});
builderr.setTitle("Golll!");
AlertDialog dialog = builderr.create();
return dialog;
}
}
Thank you.