I am developing android app. I am using alert dialog box. How can alert message color?
AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
builder.setMessage("...........congratulations...........");
builder.setCancelable(false)
.setPositiveButton("Move Next Level",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id)
{
}
});
AlertDialog alert = builder.create();
alert.setTitle(".");
alert.setIcon(R.drawable.newmovw);
alert.show();
Display message, text how can apply color in Android.
you can create a custom view to the Alert Dialog Content. which is explained in the code on APIDemos itself clearly. check the
case DIALOG_TEXT_ENTRY
in it. the class behind it is LayoutInflater. Please check that too.For Example:
Hope it helps.
Edit:
layoutname : main.xml
If the layout name is
main.xml
then you have to change the code like below: