Reputation: 484
I have overridden the OnActivated event in the app.xaml, but the handler is never executed
protected override void OnActivated (IActivatedEventArgs args)
{
//Test Code
}
Upvotes: 2
Views: 697
Reputation: 29792
I think you mix Resuming and Activation. In WP8.1 RT it works little different that in WP8.0. Please take a look at App Lifecycle. There is a list in which cases your app is being activated. For example you will have OnActivated launched after FileOpenPicker but you won't get it fired after Suspension (then the Resuming event is fired).
You won't be able to test your OnActivated by using lifecycle event dropdown. To test it you will have to get it invoked (take a look at these lifecycle events at msdn), also open project properties, go to Debug and mark a tick Do not launch, but debug my code when it starts.
Please also remeber that your app can be terminated by the OS (for example due to lack of resources) while it's deactivated/suspended.
Upvotes: 3