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

Method fireCloseEvent

CodenameOne/src/com/codename1/ui/Sheet.java:1380–1398  ·  view source on GitHub ↗
(boolean parentsToo)

Source from the content-addressed store, hash-verified

1378 }
1379
1380 private void fireCloseEvent(boolean parentsToo) {
1381 closeListeners.fireActionEvent(new ActionEvent(this));
1382 if (parentsToo && parentSheet != null) {
1383 parentSheet.fireCloseEvent(true);
1384 }
1385 // Auto-resolve a pending showForResult() with null when the sheet closes
1386 // without finish() having been called (back, swipe-dismiss, or being
1387 // replaced by another sheet). This mirrors how Android Activity onResult
1388 // semantics treat a cancelled return: subscribers see a null payload.
1389 AsyncResource<Object> r = pendingResult;
1390 if (r != null && !r.isDone()) {
1391 pendingResult = null;
1392 try {
1393 r.complete(null);
1394 } catch (Throwable t) {
1395 com.codename1.io.Log.e(t);
1396 }
1397 }
1398 }
1399
1400 /// Adds listener to be notified when user goes back to the parent. This is not
1401 /// fired if the sheet is simply closed. Only if the "back" button is pressed,

Callers 2

callMethod · 0.95
runMethod · 0.95

Calls 4

isDoneMethod · 0.65
completeMethod · 0.65
fireActionEventMethod · 0.45
eMethod · 0.45

Tested by

no test coverage detected