In MainPage.xaml.cs

I am using following code

Code:
PhoneApplicationService.Current.Activated += new EventHandler<ActivatedEventArgs>(OnActivated);
Code:
void OnActivated(object sender, ActivatedEventArgs e)
{
}
but this is causing app to close.