Search code examples
androidandroid-intentintentfilter

Instability using a 3rd party search intent


I have an app that has been published for close to a year now that utilizes the search intent of a 3rd party app. As long as the 3rd party app is in memory, the search works great. However, if Android kills the app for whatever reason, my app crashes. I have recently implemented a method that can determine whether the 3rd party app is running or not that has pretty much resolved the issue (though, Android can still kill the 3rd party app in between I test and launch the search intent).

The 3rd party app that I call is rather large and takes 10 or so seconds to launch. If I utilize the search intent too soon, both apps crash. I can't seem to trap the exception but that isn't my concern. My question is this: does anyone know of a way that can be employed (besides Thread.sleep) that can guarantee either a) my app can determine whether the search intent is "available" (this is what I really want to know though it sounds like nonsense given the way intents work) or b) a way that I can trap such a failure (I have tried UncaughtExceptionHandler with no success).

Regards


Solution

  • I believe that this actually was a problem with android o/s killing the app due to low memory.