StartActivityForResults always returns RESULT_CANCELLED for Intent.ACTION_SEND

startActivityForResult() only works with activities that are intended to be called that way. If the activity you are calling doesn’t explicitly return a result, you will get the default result RESULT_CANCELED. Obviously ACTION_SEND is not designed to be called this way. The documentation for ACTION_SEND indicates that is generates no output (ie: generates no result).

See the documentation for Activity.startActivityForResult():

Note that this method should only be used with Intent protocols that
are defined to return a result. In other protocols (such as
ACTION_MAIN or ACTION_VIEW), you may not get the result when you
expect. For example, if the activity you are launching uses the
singleTask launch mode, it will not run in your task and thus you will
immediately receive a cancel result.

Leave a Comment