Use this:
AlertDialog alert = builder.create(); alert.show(); TextView msgTxt = (TextView) alert.findViewById(android.R.id.message); msgTxt.setTextSize(16.0);
in your case:
Button submit = (Button) findViewById(R.id.submitButton); submit.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { AlertDialog.Builder builder = new AlertDialog.Builder(Application1GoodExample.this); builder.setMessage("Your form has been successfully submitted"); builder.setNegativeButton("Exit", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } });
If this does not help you, send a LogCat error message to your question.
Awadkab
source share