I have app start with Splash screen then open listactivity rows, clicking on any row will opens an activity containing a textview, two buttons (one of which opens an infinite ga
The compiler may not be able to parse/use the Arabic (correct me if I'm wrong) text.
You can try by explicitly setting each String
under UTF-8
:
String[] classes =
{
new String("example1".getBytes(), "UTF-8"),
new String("example2".getBytes(), "UTF-8")
};
Do the same for the calls to equals
in the onListItemClick
String cheese = new String(classes[position].getBytes(), "UTF-8");
if(cheese.equals(new String("المقدمة".getBytes(), "UTF-8")))
{
cheese = new String("Introduction".getBytes(), "UTF-8");
}
Better yet, just make a method.
private Object stringUTF8(final Object string)
{
try
{
return new String(((String) string).getBytes(), "UTF-8");
}
catch(UnsupportedEncodingException e)
{
e.printStackTrace();
return "error";
}
}