Answer the question
In order to leave comments, you need to log in
How to display ruble symbol ₽ in TextView?
Hello.
How to display ruble sign in textView through code? Those. something like tvCost.setText(orderCost + "₽"). When setting this character in the xml markup, everything is OK (for example, android:text="250 ₽"), but when trying to set the text using setText(), it's a disaster.
I tried both char and String, and the symbol "₽" itself, and its representation in Unicode "/u20BD" and even through getResources().getString() as well as "₽" and "/u20BD" - the result is zero, just nothing displayed in place of this character.
UPD: the problem is observed in the Genymotion emulator (Google Nexus 4, Android 4.2.2, API 17), on a Nexus 5 phone with Android 6.0 everything is ok.
UPD: solution is a picture instead of a symbol in the comments to LeEnot 's answer
Answer the question
In order to leave comments, you need to log in
Try like this:
The fact is that on some fonts in Android there is no ruble symbol .
You need to set a custom font where this character is present like this:
Typeface myFont = Typeface.createFromAsset(getAssets(),"fonts/NotoSans-Regular.ttf");
tvCost.setTypeface(myFont);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question