putextra puts data in RAM memory

Asked

Viewed 36 times

1

putextra puts data into the RAM?

I have to do getIntent().removeExtra("nome") to delete the contents?

  • I do not understand the purpose of your question. Can you explain why?

  • i would like to know how far putextra data is available. it is up to the next Activity that I call?

  • Data becomes available as the Intent is available. Edit the question and add an example code that exemplifies your question.

1 answer

0

Unable to delete this content.

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

In addition, the method getIntent() would take a copy of the original Intent, you would not be changing the Intent that was used, but rather a copy of it and removing the extras from that copy. So if you give getIntent() again, you’d be making another copy of the original that would have the extras again.

The kind of data you go through Intent usually has very small size, so there is little need to try to remove them. After all, if you switched to another activity they have important value for activity. Most likely, if the pause or stop were called during the execution (locked screen, went to the start screen and came back, etc), this extra would be needed again in the recreation of the activity.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.