dextorer / Sofa

A library for Android TV that extends the Leanback library functionalities
Other
148 stars 34 forks source link

onCreate called everytime for fragment #9

Open philipgiuliani opened 8 years ago

philipgiuliani commented 8 years ago

Hi, i have extended RowsFragment for the BrowseFragment, everytime when i select the view in the navigation (left side) the onCreate, onCreateView, onViewCreated methods of the fragment are called again, but the global variables persist...

Currently i have the following in my onCreate:

// load data
if (mRecordedBroadcasts == null) {
    mArchiveCall = mApp.getService().archivedBroadcasts();
    mArchiveCall.enqueue(this);
} else {
    loadRows();
}

In my case mRecordedBroadcasts is only null the first time. So why is onCreate called everytime if its already initialized?