I have following simple code snippet:
StringBuilder sb = new StringBuilder();
Locale l = Locale.getDefault();
Formatter formatter = new Formatter( sb, l );
In documentation I see that the Formatter has following constructor:
Formatter(Appendable a, Locale l)
So why the compiler tells me there is an error in my code:
The constructor
Formatter(StringBuilder, Locale) is
undefined
Sorry for such simple questions…
BR
STeN
Answer (added later): I was by mistake using the android.text.format.Formatter, which was automatically imported by Eclipse instead of java.util.Formatter.
That code works for me. Do you have an import problem? There are three Formatter classes in Android: java.util, android.text.formatting, and android.util.logging.