Alertdialog ANDROID accent error

Asked

Viewed 929 times

1

I’m having problems with the AlertDialog, when opened it exhibits the accents and neither cedilla, in the place appears that old "triangle with interrogation in". What to do to solve?

public void alertaInternet(){
    AlertDialog.Builder alertDialog = new AlertDialog.Builder(mContext);

    // Definindo Dialog Title
    alertDialog.setTitle("Sem conexão a internet!");

    // Definindo Dialog Message
    alertDialog.setMessage("O aplicativo precisa de conexão a internet para prosseguir.");

    // Ao pressionar o botão OK
    alertDialog.setNegativeButton("Fechar", new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog, int which) {
            dialog.cancel();
        }
    });

    // Mostrando Alert Message
    alertDialog.show();
}
  • Post the code you’re using.

  • ready, already edited up.

  • I already had this problem using Android Studio, I created the message in my string.xml and recovered to display. <string name="message">The application needs internet connection to proceed. </string> alertDialog.setMessage(getString(R.string.message));

  • I was able to solve by changing the decoding of the file from "windows-1252" to "UTF-8".

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.