Nit, rephrase:
```javascript
  // An activity can be closed either by pressing the 'X' button
  // or by a visibility change (i.e. home button or app switch).
```