MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / init

Method init

Samples/samples/SocketSample/SocketSample.java:39–60  ·  view source on GitHub ↗
(Object context)

Source from the content-addressed store, hash-verified

37 private Resources theme;
38
39 public void init(Object context) {
40 // use two network threads instead of one
41 updateNetworkThreadCount(2);
42
43 theme = UIManager.initFirstTheme("/theme");
44
45 // Enable Toolbar on all Forms by default
46 Toolbar.setGlobalToolbar(true);
47
48 // Pro only feature
49 Log.bindCrashProtection(true);
50
51 addNetworkErrorListener(err -> {
52 // prevent the event from propagating
53 err.consume();
54 if(err.getError() != null) {
55 Log.e(err.getError());
56 }
57 Log.sendLogAsync();
58 Dialog.show("Connection Error", "There was a networking error in the connection to " + err.getConnectionRequest().getUrl(), "OK", null);
59 });
60 }
61
62 public void start() {
63 if(current != null){

Callers

nothing calls this directly

Calls 12

initFirstThemeMethod · 0.95
setGlobalToolbarMethod · 0.95
bindCrashProtectionMethod · 0.95
eMethod · 0.95
sendLogAsyncMethod · 0.95
showMethod · 0.95
getConnectionRequestMethod · 0.80
consumeMethod · 0.65
getErrorMethod · 0.65
getUrlMethod · 0.45

Tested by

no test coverage detected