title: How to execute code when app is killed by swiping in android?
body: <p>so basically i created an app using C# on xamarin and everything runs perfect. i called an event handler that when i press back button on android it doesen`t exit the app but it just moves it on background. For that i used :</p>
  
  <pre><code>public override void OnBackPressed()
      {
          MoveTaskToBack(true);
      }
  </code></pre>
  
  <p>Now i want that if the user wants to kill the app with swiping from task i want it to execute a code just before closing. I did some research and figured out i should use something like :</p>
  
  <pre><code>public override  void OnTaskRemoved( )
      {
      //the code here
      }
  </code></pre>
  
  <p>The problem is that when i write the above code i get an error saying "Error CS0115 'MainActivity.OnTaskRemoved(Intent)': no suitable method found to override"</p>
  
  <p>If i remove override there is no error but the code i put inside is not executed when app is killed with swipe. Can someone help with this ? Thanks</p>