I have a popup for downloading the audio instruction in my app. What I am trying to do is to change the default text color of "OK" to blue. I tried something but it's not working. Here is my code:
private void showDownloadPgmPopup() { android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(getActivity()); builder.setTitle("Download instructional audio?"); builder.setMessage(ParamConstants.AUDIODOWNLOADPERMISSION); builder.setNegativeButton("No", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { WwDatabaseHelper.storeSelectedWeekAndDay(getActivity(), mSelectedWeekDataModel); goToMoveScreen(); } }); builder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { AndroidDownloadFileByProgressBarActivity.StartAudioAssetDownload(getActivity()); } }).create(); // change the text color of download instruction ok button final android.app.AlertDialog dialog = builder.show(); dialog.setOnShowListener( new DialogInterface.OnShowListener() { @Override public void onShow(DialogInterface arg0) { dialog.getButton(AlertDialog.BUTTON_POSITIVE).setTextColor(Color.parseColor("#ff5722")); } }); dialog.setCanceledOnTouchOutside(false); dialog.show(); } But the change is not taking effect, can anyone tell me what I am doing wrong?


