How can i show Hindi text in Android Tablet

后端 未结 3 874
北荒
北荒 2020-12-09 23:02

I am developing an application in Android Tablet. Now in my application, I want to show Hindi text for all EditText and Buttons and also I need to get data

3条回答
  •  猫巷女王i
    2020-12-09 23:43

    you can use Unicode ...for क ख

    TextView tv=(TextView)findViewById(R.id.textViewmyView);
    
    final Typeface tf = Typeface.createFromAsset(this.getAssets(), "Hindi-SARAL1.TTF");
    
    tv.setText(Html.fromHtml("&# 2325;&# 2326;"));
    
    tv.setTypeface(tf);
    

    use Unicode value continues no gap....

    this code is working for all alphabets of Hindi except.क्ष,त्र and ज्ञ for this you can use......

    for क्ष:- tv.setText("9");

    for त्र :- tv.setText("5");

    and for ज्ञ:- tv.setText(")");

    after that

    tv.setTypeface(tf);
    

提交回复
热议问题