java - Objects auto-deleted from Activity instance? -


i have single activity application mainactivity takes care of changing between different fragments.

firstfragmentcollects sensor data, , @ end stores in mainacitvityvia ((mainactivity)getactivity()).setvalues(values);

secondfragment presents items in recyclerview (not important case), 1 of these button open thirdfragment. in fragment list of objects still alive can see log.i(tag, ((mainactivity)getactivity()).getvalues().tostring());

thirdfragmentoffers possibility write comments , save these alongside sensor data found in ((mainactivity)getactivity).getvalues(); persistent storage (internalstorage serialization + sql row reference filename).

problem is, time in thirdfragment, mainactivity's list of objects gone. i've spent time debugging this, , cannot see these objects deleted. also, new problem, , cannot see of new adjustments code should affect mainactivity's list.

this has lead me believe there may functionality in android os automatically deletes old objects? case? if so, better off persistently storing data in mainactivity , bring storage in thirdfragment.

from mainactivity

public arraylist<gsrconverted> getvalues() {     return values; }  public void setvalues(arraylist<gsrconverted> values) {     this.values = values;     log.i(tag, "values set"); }  public void removevalues() {     values.clear();     log.i(tag, "values removed"); } 

these called designed, not called in-between secondfragmentand thirdfragment


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -