How to support Arabic text in Android?

前端 未结 4 961
既然无缘
既然无缘 2020-11-22 03:41

I am getting Arabic text from server successfully. Retrieved text I want display in code but its showing boxes instead of Arabic text. Assume that t array value

4条回答
  •  情书的邮戳
    2020-11-22 03:59

    try to copy any arabic font into assets folder and set that font and check may be it works

    string[] t={"arabic words here"};
    TextView tv=(TextView)findViewById(R.id.text); 
    Typeface face=Typeface.createFromAsset(getAssets(), "fonts/HandmadeTypewriter.ttf");
    tv.setTypeface(face)
    

    use the arabic font insted of HandmadeTypewriter.ttf font or

    try to set the static arabic text and check its working or not ?

    string[] t={"arabic words here"};
    Textview tv=(Textview)findviewByid(R.id.text);
    tv.setText(t[0]);
    

提交回复
热议问题