Created
May 30, 2017 08:35
-
-
Save EfeBudak/5f7328413e836279ac106bf046f631ee to your computer and use it in GitHub Desktop.
Android Pagination with MVP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
... | |
mPresenter = new Presenter( | |
fragment, | |
SchedulerProvider.getInstance(), | |
Repository.getInstance( | |
LocalDataSource.getInstance(), | |
RemoteDataSource.getInstance())); | |
if (savedInstanceState != null) { | |
mPresenter.restoreCurrentPage(savedInstanceState.getInt(BUNDLE_CURRENT_PAGE)); | |
} | |
} | |
@Override | |
protected void onSaveInstanceState(Bundle outState) { | |
outState.putInt(BUNDLE_CURRENT_PAGE, mPresenter.getCurrentPage()); | |
super.onSaveInstanceState(outState); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment