Mohsen Armoun Mohsen Armoun - 1 year ago 225
Android Question

How to use getCurrencyInstance and format in low api?

I am getting an error in the following code:

private void displayPrice (int number) {

TextView price = (TextView)findViewById(;

The error I am getting is as follows:

Call requires API level 24 (current min is 14):

Android API 24 can use this. How can I use this in low API like
API 15

Answer Source

Change your import to use java.text.NumberFormat (available from API 1) instead of (available from API 24).

The ICU4J framework provides better internationalization support, but it is not required.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download