|
|
@@ -46,7 +46,7 @@ namespace Cordova.Extension.Commands
|
|
|
/// <summary>
|
|
|
/// Informs either the app is running in background or foreground
|
|
|
/// </summary>
|
|
|
- private bool RunsInBackground = true;
|
|
|
+ private bool RunsInBackground = false;
|
|
|
|
|
|
/// <summary>
|
|
|
/// Sets application live tile
|
|
|
@@ -140,22 +140,6 @@ namespace Cordova.Extension.Commands
|
|
|
DeviceReady = true;
|
|
|
}
|
|
|
|
|
|
- /// <summary>
|
|
|
- /// Called when the application has been switched to background
|
|
|
- /// </summary>
|
|
|
- public void pause (string jsonArgs)
|
|
|
- {
|
|
|
- RunsInBackground = true;
|
|
|
- }
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// Called when the application has been switched to foreground
|
|
|
- /// </summary>
|
|
|
- public void resume (string jsonArgs)
|
|
|
- {
|
|
|
- RunsInBackground = false;
|
|
|
- }
|
|
|
-
|
|
|
/// <summary>
|
|
|
/// Creates tile data
|
|
|
/// </summary>
|
|
|
@@ -215,5 +199,22 @@ namespace Cordova.Extension.Commands
|
|
|
{
|
|
|
return RunsInBackground ? "background" : "foreground";
|
|
|
}
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// Occurs when the application is being deactivated.
|
|
|
+ /// </summary>
|
|
|
+ public override void OnPause (object sender, DeactivatedEventArgs e)
|
|
|
+ {
|
|
|
+ RunsInBackground = true;
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// Occurs when the application is being made active after previously being put
|
|
|
+ /// into a dormant state or tombstoned.
|
|
|
+ /// </summary>
|
|
|
+ public override void OnResume (object sender, Microsoft.Phone.Shell.ActivatedEventArgs e)
|
|
|
+ {
|
|
|
+ RunsInBackground = false;
|
|
|
+ }
|
|
|
}
|
|
|
}
|