android/experimental/DocumentLoader/src/org/libreoffice/android/examples/DocumentLoader.java | 15 ++-------- 1 file changed, 4 insertions(+), 11 deletions(-)
New commits: commit a3b8cfa65c7883295cd899e71fd2979958a880ce Author: Miklos Vajna <vmik...@suse.cz> Date: Thu Nov 22 15:53:35 2012 +0100 android: clean up no longer needed onSaveInstanceState() It could not be used to save whole objects, so get rid of it and use onRetainNonConfigurationInstance() exclusively. Change-Id: I7cc3951b60a054b5b2488b49791b58707dc8a68b diff --git a/android/experimental/DocumentLoader/src/org/libreoffice/android/examples/DocumentLoader.java b/android/experimental/DocumentLoader/src/org/libreoffice/android/examples/DocumentLoader.java index 3ee60ac..fcf9fae 100644 --- a/android/experimental/DocumentLoader/src/org/libreoffice/android/examples/DocumentLoader.java +++ b/android/experimental/DocumentLoader/src/org/libreoffice/android/examples/DocumentLoader.java @@ -870,6 +870,8 @@ public class DocumentLoader public int pageCount; public XRenderable renderable; public String input; + // This is not updated constantly, just in onRetainNonConfigurationInstance() + public int currentPageNumber; } static void dumpUNOObject(String objectName, Object object) @@ -933,16 +935,10 @@ public class DocumentLoader } @Override - public void onSaveInstanceState(Bundle savedInstance) - { - super.onSaveInstanceState(savedInstance); - savedInstance.putInt("currentPageNumber", ((PageViewer)flipper.getCurrentView()).currentPageNumber); - } - - @Override public Object onRetainNonConfigurationInstance() { ArrayList ret = new ArrayList(2); ret.add(bootstrapContext); + documentContext.currentPageNumber = ((PageViewer)flipper.getCurrentView()).currentPageNumber; ret.add(documentContext); return ret; } @@ -1089,10 +1085,7 @@ public class DocumentLoader matchParent = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); - int currentPageNumber = 0; - if (savedInstanceState != null) - currentPageNumber = savedInstanceState.getInt("currentPageNumber"); - goToPage(currentPageNumber); + goToPage(documentContext.currentPageNumber); setContentView(flipper); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits