I'm trying to add items to a Spinner :
private static final String[]paths = {"فارسی", "English"};
ddlFrom = (Spinner)findViewById(R.id.ddlFrom);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(MainActivity.this,
android.R.layout.simple_spinner_item,paths);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
ddlFrom.setAdapter(adapter);
But the result has problems with Persian string and my spinner in device shows "?????" instead of "فارسی"
for "English" it is correct.
please help me.
You need to set the file encoding of the file that contains the arabic text to UTF-8.
You need to check your editor/IDE settings - for Android Studio go to Settings -> Editors -> File Encodings and check files and project encoding.
This is how you change file encoding from inside Android-Studio.