for setAction() should I use Intent.ACTION_SEND and Intent.ACTION_SEND_MULTIPLE?
That is your choice to make, as the author of the app. If you are expecting to share one piece of text (that you assembled from many pieces yourself), use ACTION_SEND
. If you are expecting to share many pieces of text, use ACTION_SEND_MULTIPLE
.
Note that I would expect about a 100:1 ratio of apps supporting ACTION_SEND
compared to ACTION_SEND_MULTIPLE
. So, if your objective is for this sharing to be generally useful, you would want to steer towards ACTION_SEND
.
More importantly, you need to determine what the users are going to want to do. Presumably, the point behind your development is for 1+ humans to use this app. If the user of the app is expecting to send one email, or post one tweet, or upload one note based on this data, you should be using ACTION_SEND
. If, instead, the user will be expecting to send N messages (or whatever), then that would be something to try with ACTION_SEND_MULTIPLE
.
When setting the content, should I use putExtra or putParcelableArrayListExtra?
For ACTION_SEND
, it would be putExtra()
, passing in the String
. For ACTION_SEND_MULTIPLE
, it would be putStringArrayListExtra()
.
Do I set the Intent with the data from the ListFragment, or from the ArrayAdapter, or from the ArrayList that is fed into ArrayAdapter, or from the data before the ArrayList were constructed?
You use a String
or ArrayList<String>
as noted above. Where you get those values from is your business logic that you as a developer need to decide.