public boolean onOptionsItemSelected(MenuItem item) {
    Log.d(TAG, "menu item selected" + item.toString());
    switch (item.getItemId()) {
      case R.id.synchronise:
        Log.d(TAG, "synchronizacja");
        if (global_app.isNetworkOn())
          startService(new Intent(DefaultMapActivity.this, SynchronisationService.class));
        else Toast.makeText(this, R.string.dialog_text_no_network, Toast.LENGTH_SHORT).show();
        break;

      case R.id.preferences:
        Log.d(TAG, "ustawienia");
        startActivity(new Intent(this, PreferencesActivity.class));
        break;
    }
    return true;
  }