Change text color of alert dialog
<p>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 &quot;OK&quot; to blue. I tried something but it's not working. Here is my code:</p>
<pre><code> private void showDownloadPgmPopup() {

    android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(getActivity());
    builder.setTitle(&quot;Download instructional audio?&quot;);
    builder.setMessage(ParamConstants.AUDIODOWNLOADPERMISSION);
    builder.setNegativeButton(&quot;No&quot;, new DialogInterface.OnClickListener() {
        @Override
        public void onClick(DialogInterface dialog, int which) {
            WwDatabaseHelper.storeSelectedWeekAndDay(getActivity(), mSelectedWeekDataModel);
            goToMoveScreen();
        }
    });
    builder.setPositiveButton(&quot;OK&quot;, 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(&quot;#ff5722&quot;));
                                  }
                              });
    dialog.setCanceledOnTouchOutside(false);
    dialog.show();
}
</code></pre>
<p>But the change is not taking effect, can anyone tell me what I am doing wrong?</p>