I have read, http://developer.android.com/guide/components/tasks-and-back-stack.html and I have looked up the documentation for FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET
, but I still do not understand why a employee at Google decided to include it in their blog post about sharing.
http://android-developers.blogspot.com/2012/02/share-with-intents.html
Here is their code snippet exactly:
Intent intent=new Intent(android.content.Intent.ACTION_SEND);
intent.setType("text/plain");
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
// Add data to the intent, the receiving app will decide what to do with it.
intent.putExtra(Intent.EXTRA_SUBJECT, “Some Subject Line”);
intent.putExtra(Intent.EXTRA_TEXT, “Body of the message, woot!”);
The documentation says:
If set, this marks a point in the task's activity stack that should be cleared when the task is reset...
I am still very unsure of this flag. I'm not sure I can think of a reason to include it in my share() method, but if Google used it in a blog post, then I'm sure they know of a scenario where this comes into play. Thanks in advance.