Search code examples
androidandroid-intentintentfilterandroid-service

Android can ACTION_SEND be used to call a Service


I've successfully being able to use the ACTION_SEND intent which displays my application in the list when the share button is pressed in the gallery. My app basically sends the selected picture to my computer and no further input form the user is required. Rather than starting my app when selected in the list which is an unnecessary step is it possible to pass the data to my own service which sends the picture and avoid starting my app?

If not what other options do I have? Start my app, sent the picture and close the activity?


Solution

  • Rather than starting my app when selected in the list which is an unnecessary step is it possible to pass the data to my own service which sends the picture and avoid starting my app?

    ACTION_SEND is used for starting activities, not services -- sorry.

    If not what other options do I have? Start my app, sent the picture and close the activity?

    Sounds reasonable. If you do all of that in onCreate(), call finish(), and never call setContentView(), nothing will be shown to the user.