Currently, Titanium does not have an API to detect if there are any registered activities that can be started for a given intent. An app developer's only option is to call Titanium's startActivity() method and see if it throws an exception or not. This is an issue for apps that need to detect this in advance without launching an activity.
Add a new canStartActivity(Intent) method to Ti.Android.Activity which will return true if at least 1 activity was found for the given intent.
Internally, this should call Google's PackageManager.resolveActivity() method, where if it returns a non-null reference, then we know an activity exists for the given intent. Alternatively, we could call Google's PackageManager.queryIntentActivities() method which returns a list of activities matching the given intent, where we could check if at least 1 activity was returned.
Can be used to detect if there is a 3rd party app installed for viewing a file, such as PDF. If canStartActivity() returns false, then you can alert the end-user that viewer app needs to be installed.
While it would be more powerful to provide a queryIntentActivities() method in Titanium, the vast majority of app developers simply want to know if at least 1 activity exists. So, it's better to keep it simple for now. The only good use-case I've heard where you want to scrutinize the activity list is when you want to exclude an activity from a particular app that has known issues.