1) I believe Class.forName(String name) is deprecated because classes names are rename on differents way according to the platform.
2) It require Java reflection which is not supported by CN1. 3) I think you could use "Class.newInstance()" method (not sure about that) On Wednesday, May 25, 2016 at 1:00:40 PM UTC+2, [email protected] wrote: > > Hi, > > I espone two question: > > > - why Class.forName has been deprecated? > > Class cls = Class.forName(classname); > > > - and why getConstructor has been removed? > > AppController controller = (AppController) cls.getConstructor( > RoutingContext.class, Logger.class).newInstance(context, logger); > > > How I can to instance a class dinamically? > > > thanks > > Dario > -- You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. Visit this group at https://groups.google.com/group/codenameone-discussions. To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/b0d660ba-7976-4f9f-85a9-41c15547309f%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
