I have created a AlertDialog in my app. Before Android L AlertDialog buttons fit in dialog box, but in Android L buttons label automatically converts in title case and buttons not fit in dialog box. Please see screenshots: Android L:
Android Kitkat:
Is anybody see this issue. Can any help me to solve this problem, although this is latest android version.
Code: (I have not used xml code to create dialog, here is java code:)
AlertDialog.Builder alert = new AlertDialog.Builder(this);
alert.setTitle(R.string.feedback_label);
alert.setMessage(msgStrId);
alert.setNegativeButton(R.string.close_label, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
}
});
alert.setPositiveButton(R.string.rate_app, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
}
});
alert.setNeutralButton(R.string.feedback_label,new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which)
{
// TODO Auto-generated method stub
}
});
alert.setOnCancelListener(new DialogInterface.OnCancelListener()
{
@Override
public void onCancel(DialogInterface dialog)
{
// TODO Auto-generated method stub
}
});
AlertDialog alertDialog = alert.create();
alertDialog.show();