Use custom Alerbox, use this code when clicked. I created a custom layout "alert_input" and the "OK" and "Cancel" options will appear
LayoutInflater layoutInflater = LayoutInflater.from(Login.this); View promptView = layoutInflater.inflate(R.layout.alert_input, null); final EditText editText = (EditText) promptView.findViewById(R.id.alertEdit2); final EditText editText2 = (EditText) promptView.findViewById(R.id.alertEdit3); final TextView at=(TextView)findViewById(R.id.alertText); AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(Login.this,AlertDialog.THEME_HOLO_LIGHT); alertDialogBuilder.setView(promptView); alertDialogBuilder.setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { } }) .setNegativeButton("Cancel", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } });
source share