ims.main
Class GpsChildFinder

java.lang.Object
  extended by android.content.Context
      extended by android.content.ContextWrapper
          extended by android.app.Application
              extended by ims.main.GpsChildFinder
All Implemented Interfaces:
android.content.ComponentCallbacks, android.content.ComponentCallbacks2

public class GpsChildFinder
extends android.app.Application

Base class to maintain global application state. This class stores the instances of all the used activities and provides them to the whole application, packages and classes.

Copyright © 2014 by Daniela Blum

This file is part of GPSChildFinder.
GPSChildFinder is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses.

Author:
Daniela Blum

Nested Class Summary
 
Nested classes/interfaces inherited from class android.app.Application
android.app.Application.ActivityLifecycleCallbacks, android.app.Application.OnProvideAssistDataListener
 
Field Summary
static android.bluetooth.BluetoothAdapter BLUETOOTH_ADAPTER
          The Bluetooth adapter witch is set in the startingActivity after Bluetooth service is turned on
 
Fields inherited from class android.content.Context
ACCESSIBILITY_SERVICE, ACCOUNT_SERVICE, ACTIVITY_SERVICE, ALARM_SERVICE, APP_OPS_SERVICE, AUDIO_SERVICE, BIND_ABOVE_CLIENT, BIND_ADJUST_WITH_ACTIVITY, BIND_ALLOW_OOM_MANAGEMENT, BIND_AUTO_CREATE, BIND_DEBUG_UNBIND, BIND_IMPORTANT, BIND_NOT_FOREGROUND, BIND_WAIVE_PRIORITY, BLUETOOTH_SERVICE, CAPTIONING_SERVICE, CLIPBOARD_SERVICE, CONNECTIVITY_SERVICE, CONSUMER_IR_SERVICE, CONTEXT_IGNORE_SECURITY, CONTEXT_INCLUDE_CODE, CONTEXT_RESTRICTED, DEVICE_POLICY_SERVICE, DISPLAY_SERVICE, DOWNLOAD_SERVICE, DROPBOX_SERVICE, INPUT_METHOD_SERVICE, INPUT_SERVICE, KEYGUARD_SERVICE, LAYOUT_INFLATER_SERVICE, LOCATION_SERVICE, MEDIA_ROUTER_SERVICE, MODE_APPEND, MODE_ENABLE_WRITE_AHEAD_LOGGING, MODE_MULTI_PROCESS, MODE_PRIVATE, MODE_WORLD_READABLE, MODE_WORLD_WRITEABLE, NFC_SERVICE, NOTIFICATION_SERVICE, NSD_SERVICE, POWER_SERVICE, PRINT_SERVICE, SEARCH_SERVICE, SENSOR_SERVICE, STORAGE_SERVICE, TELEPHONY_SERVICE, TEXT_SERVICES_MANAGER_SERVICE, UI_MODE_SERVICE, USB_SERVICE, USER_SERVICE, VIBRATOR_SERVICE, WALLPAPER_SERVICE, WIFI_P2P_SERVICE, WIFI_SERVICE, WINDOW_SERVICE
 
Fields inherited from interface android.content.ComponentCallbacks2
TRIM_MEMORY_BACKGROUND, TRIM_MEMORY_COMPLETE, TRIM_MEMORY_MODERATE, TRIM_MEMORY_RUNNING_CRITICAL, TRIM_MEMORY_RUNNING_LOW, TRIM_MEMORY_RUNNING_MODERATE, TRIM_MEMORY_UI_HIDDEN
 
Constructor Summary
GpsChildFinder()
           
 
Method Summary
 android.app.Activity getCurrentActivity()
           
 MainActivity getMainActivity()
           
 SettingsActivity getSettingsActivity()
           
 StartingActivity getStartingActivity()
           
 void setCurrentActivity(android.app.Activity currentActivity)
           
 void setMainActivity(MainActivity mainActivity)
           
 void setSettingsActivity(SettingsActivity settingsActivity)
           
 void setStartingActivity(StartingActivity startingActivity)
           
 void updateScreen()
          Updates the screen depending on the current activity.
 
Methods inherited from class android.app.Application
onConfigurationChanged, onCreate, onLowMemory, onTerminate, onTrimMemory, registerActivityLifecycleCallbacks, registerComponentCallbacks, registerOnProvideAssistDataListener, unregisterActivityLifecycleCallbacks, unregisterComponentCallbacks, unregisterOnProvideAssistDataListener
 
Methods inherited from class android.content.ContextWrapper
bindService, checkCallingOrSelfPermission, checkCallingOrSelfUriPermission, checkCallingPermission, checkCallingUriPermission, checkPermission, checkUriPermission, checkUriPermission, clearWallpaper, createConfigurationContext, createDisplayContext, createPackageContext, databaseList, deleteDatabase, deleteFile, enforceCallingOrSelfPermission, enforceCallingOrSelfUriPermission, enforceCallingPermission, enforceCallingUriPermission, enforcePermission, enforceUriPermission, enforceUriPermission, fileList, getApplicationContext, getApplicationInfo, getAssets, getBaseContext, getCacheDir, getClassLoader, getContentResolver, getDatabasePath, getDir, getExternalCacheDir, getExternalCacheDirs, getExternalFilesDir, getExternalFilesDirs, getFilesDir, getFileStreamPath, getMainLooper, getObbDir, getObbDirs, getPackageCodePath, getPackageManager, getPackageName, getPackageResourcePath, getResources, getSharedPreferences, getSystemService, getTheme, getWallpaper, getWallpaperDesiredMinimumHeight, getWallpaperDesiredMinimumWidth, grantUriPermission, isRestricted, openFileInput, openFileOutput, openOrCreateDatabase, openOrCreateDatabase, peekWallpaper, registerReceiver, registerReceiver, removeStickyBroadcast, removeStickyBroadcastAsUser, revokeUriPermission, sendBroadcast, sendBroadcast, sendBroadcastAsUser, sendBroadcastAsUser, sendOrderedBroadcast, sendOrderedBroadcast, sendOrderedBroadcastAsUser, sendStickyBroadcast, sendStickyBroadcastAsUser, sendStickyOrderedBroadcast, sendStickyOrderedBroadcastAsUser, setTheme, setWallpaper, setWallpaper, startActivities, startActivities, startActivity, startActivity, startInstrumentation, startIntentSender, startIntentSender, startService, stopService, unbindService, unregisterReceiver
 
Methods inherited from class android.content.Context
getString, getString, getText, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BLUETOOTH_ADAPTER

public static android.bluetooth.BluetoothAdapter BLUETOOTH_ADAPTER
The Bluetooth adapter witch is set in the startingActivity after Bluetooth service is turned on

Constructor Detail

GpsChildFinder

public GpsChildFinder()
Method Detail

getCurrentActivity

public android.app.Activity getCurrentActivity()
Returns:
the current activity in the foreground

setCurrentActivity

public void setCurrentActivity(android.app.Activity currentActivity)
Parameters:
currentActivity - to set

updateScreen

public void updateScreen()
Updates the screen depending on the current activity.
In case of mainActivity the Options menu is invalidated MainActivity.invalidateOptionsMenu(), otherwise (in case of the settingsActivity) the SettingsActivity.restart() is called.


getMainActivity

public MainActivity getMainActivity()
Returns:
the instantiated MainActivity

setMainActivity

public void setMainActivity(MainActivity mainActivity)
Parameters:
mainActivity - to set

getSettingsActivity

public SettingsActivity getSettingsActivity()
Returns:
the instantiated SettingActivity

setSettingsActivity

public void setSettingsActivity(SettingsActivity settingsActivity)
Parameters:
settingsActivity - to set

getStartingActivity

public StartingActivity getStartingActivity()
Returns:
the instantiated startingActivity

setStartingActivity

public void setStartingActivity(StartingActivity startingActivity)
Parameters:
startingActivity - to set