Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7742383
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T09:15:45+00:00 2026-06-01T09:15:45+00:00

I keep adding data to a List as my app runs. When I close

  • 0

I keep adding data to a List as my app runs. When I close it and run the app again, the old list is somehow still there and the new data is added to the end of it. I don’t want this to happen and I don’t know why it’s happening… I think I’m initializing it properly and closing things with onPause() and onDestroy().

I’m not quite sure what’s going on or where, and maybe the problem is from elsewhere in the code… All I know is that the app is not working right (on the first run it doesn’t work like its supposed to, but when I close it and run it again it works just fine). And this was the only fishy, seemingly related problem (?) I could find in several hours. I don’t even know what part of my code to post so I’m not looking for any specific answers, but any insights, ideas, or tips would be greatly appreciated.

EDIT: Okay, I fixed the specific issue with the List, by initializing it in OnResume(), as suggested. However, the problem remains that on the first run, things are derpy, but closing and reopening it fixes everything. It seems like there’s still something going on that transfers over…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T09:15:46+00:00Added an answer on June 1, 2026 at 9:15 am

    Read these…

    Application Fundamentals

    Activity

    In particular learn that the concept of an app is not the same as any individual application component such as an Activity. Also understanding the Activity life-cycle (creation, starting, resuming, pausing, stopping, destruction) is paramount to understanding where and when to perform various actions.

    Sorry – a bit of a generic answer but as you haven’t provided any code it’s not possible to give anything definitive.

    One thing I will say though is both of those links above when combined would probably solve 50% of all the common Android questions I see here on SO.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Keep going around circles, but I am still unclear about this. Have a feeling
I keep getting a 'List does not exist' error whenever I try and use
I am loading json into a list of objects I am adding to a
gcc has a very nice extension in C that allows you to keep data
I am building a dynamic form in that the user can keep adding entries
I am trying to implement a linked list for a data structures class and
Keep getting this error after inserting a subdatasheet into a query and trying to
Keep getting the error Arguments are not sufficiently instantiated for the multiplication by addition
keep in mind I normally use pure as3 and FlashDevelop :) I am really
I keep getting this : DeprecationWarning: integer argument expected, got float How do I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.