Problem solved using ```ApplicationObject```. Every activity overrides ```MenuActivity``` now, which gives access to this object and sets flag about application state (background or foreground).