1

I have a problem about turkish characters in Android Studio. I clicked File > Settings. Default Encoding, IDE and Project Encoding are Windows-1254. But i still get wrong characters in my code.

My wrong code is :

    public void showAlertExit() {
    AlertDialog.Builder alertbox = new AlertDialog.Builder(this);
    alertbox.setTitle("��k��");
    alertbox.setCancelable(false);
    alertbox.setMessage("��k�� yapmak istedi�inize emin misiniz?");
    alertbox.setNegativeButton("Hay�r",new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface arg0, int arg1) {
            arg0.cancel();
        }
    });
    alertbox.setPositiveButton("Evet",new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog, int arg1) {
            Intent i = new Intent(getApplicationContext(),Login.class);
            startActivity(i);
        }
    });
    AlertDialog alert = alertbox.create();  
    alert.show();
}

I clicked "Invalidate caches/Restart" but still wrong. If i do "Right click -> File Encoding -> Windows-1254 -> Convert -> Convert Anyway", My code is seem that :

    public void showAlertExit() {
    AlertDialog.Builder alertbox = new AlertDialog.Builder(this);
    alertbox.setTitle("??k??");
    alertbox.setCancelable(false);
    alertbox.setMessage("??k?? yapmak istedi?inize emin misiniz?");
    alertbox.setNegativeButton("Hay?r",new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface arg0, int arg1) {
            arg0.cancel();
        }
    });
    alertbox.setPositiveButton("Evet",new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog, int arg1) {
            Intent i = new Intent(getApplicationContext(),Login.class);
            startActivity(i);
        }
    });
    AlertDialog alert = alertbox.create();  
    alert.show();
}

Please someone help me :(

Bajirao Shinde
  • 1,356
  • 1
  • 18
  • 26

0 Answers0