putextra puts data in RAM memory

1

putextra puts data in RAM?

Do I have to getIntent().removeExtra("nome") to delete content?

    
asked by anonymous 26.05.2016 / 18:03

1 answer

0

Can not delete this content.

During the existence of this activity, the Intent will necessarily exist in memory so that you have information on how this activity was called and how it exists. A Intent is a "message" that initializes a process, an activity.

In addition, the getIntent() method would grab a copy of the original intent, you would not be altering the intent that was used, but a copy of it and removing the extras from that copy. So if you gave getIntent() again, you would be making another copy of the original that would again have the extras.

The type of data you pass Intent is usually very small, so there is not much need to try to remove them. After all, if you move on to another activity they have significant value for activity. Most likely, if the pause or stop was called during execution (screen locked, went to the home screen and returned, etc.), that extra would be needed again in the recreation of the activity.     

28.05.2016 / 15:52