I know there's this question, but '\u221e'
doesn't work for me. Also this is Android-specific. Surely there must be a way to show an infinity sign!
Asked
Active
Viewed 7,022 times
2 Answers
18
Never mind, found it myself:
DecimalFormatSymbols.getInstance().getInfinity()
Note that it may not work with some custom fonts.

Oleksiy
- 37,477
- 22
- 74
- 122
-
I use this code in the contains method as a regex and works fantastic.
∞ I cant use in regex as infinity sign. – Dezo Nov 06 '20 at 17:40
4
You can create a new item in "strings.xml":
<string name="infinity">∞</string>
And then call it using your Context:
textView.setText(context.getString(R.string.infinity));

Dmitriy Chernenko
- 41
- 2