Compiler complaining about L10NManager.format - possible issue

19 views
Skip to first unread message

P5music

unread,
Jan 24, 2021, 6:09:15 AM1/24/21
to CodenameOne Discussions
I am purging my source code from methods CodenameOne does not have.

The last one is L10NManager.format()
used like
L10NManager.format( seconds,5)

I put it in some static methods in my utility class
and
the compiler complains that non-static methods cannot be called from static context.
This is strange, probably wrong, for a method like L10NManager.format
However I moved that methods in the only place where they are used, that is non-static, and they were changed to be non-static too. I checked the "static" word and it is not present on methods of the class.
But
the compiler is complaining about the same issue
java: non-static method format(double,int) cannot be referenced from a static context
that is certainly wrong because nothing is static there.
Thanks in advance

P5music

unread,
Jan 24, 2021, 6:10:43 AM1/24/21
to CodenameOne Discussions
Of course
I meant that L10NManager.format is the replacement for the String.format method that CodenameOne does not have.

Shai Almog

unread,
Jan 24, 2021, 9:29:39 PM1/24/21
to CodenameOne Discussions
It's L10NManager.getInstance().format(...)
Reply all
Reply to author
Forward
Message has been deleted
0 new messages