Skip to content
Advertisement

TextView lost after onPause()

I’m learning how to add elements to LayoutParam. I add a TextView element after each click to “`LayoutParam“.

JavaScript

my problem is when i press the Home Button and i open the app again, i don’t see any elements. as they have never been.

Advertisement

Answer

Are you recalling the send() method in the onResume() method? if not then the data you had will be lost once the activity/fragment resumes. You would need something like this inside onResume():

JavaScript

The parameters inside send, will be whatever view you’re passing in.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement