title: Custom timeout for a method - Android
body: <p>In my android app, I'm using a method that tries to get the user's current location in a custom java class. I would like to set a timeout that, when it expires, can do whatever I want.
  I also want that timeout to be cancelable.</p>
  
  <p>How can I do this in a simple way?</p>
  
  <p>Thanks</p>