Do I need to remove Intent add-ons?

This may be a stupid question, but is there a rule that states that intentional add-ons must be explicitly removed using consuming activity, or is this only true if you recycle Intent objects?

In other words, if I always get attached to the next action, doing something like:

Intent i = new Intent(MyCurrentActivity.this, FooActivity.class);
i.putExtra("first", "stringvalue");
i.putExtra("second", 69L);
startActivity(i);

then in FooActivity I read them back ...

String first = getIntent().getStringExtra("first");
long second = getIntent().getLongExtra("second");

... I must also explicitly remove them to avoid accidentally contaminating the future intention of the activity, or from the moment I finish grasping them, can I just forget that they exist and continue?

I can swear I remember reading something that said I should delete them, but I could not find it again, and I suspect that it can only be applied to reusable targets.

+3
1

Intent, ( ) , . , . , , ?

, , .

+2

All Articles