From: Xavi Artigas Date: Mon, 12 Nov 2012 09:09:56 +0000 (+0100) Subject: Allow the file chooser to preserve the current path across device orientation changes. X-Git-Tag: 1.19.3~489^2~562^2~69 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ee528a93f8de68b2d56f1e90e088eddcd81aaa19;p=platform%2Fupstream%2Fgstreamer.git Allow the file chooser to preserve the current path across device orientation changes. --- diff --git a/gst-sdk/tutorials/android-tutorial-5/src/com/lamerman/FileDialog.java b/gst-sdk/tutorials/android-tutorial-5/src/com/lamerman/FileDialog.java index fc56383..e2ef765 100644 --- a/gst-sdk/tutorials/android-tutorial-5/src/com/lamerman/FileDialog.java +++ b/gst-sdk/tutorials/android-tutorial-5/src/com/lamerman/FileDialog.java @@ -137,7 +137,12 @@ public class FileDialog extends ListActivity { }); - String startPath = getIntent().getStringExtra(START_PATH); + String startPath; + if (savedInstanceState != null) { + startPath = savedInstanceState.getString("currentPath"); + } else { + startPath = getIntent().getStringExtra(START_PATH); + } startPath = startPath != null ? startPath : ROOT; getDir(startPath); @@ -320,4 +325,10 @@ public class FileDialog extends ListActivity { } } + @Override + protected void onSaveInstanceState(Bundle outState) { + outState.putString("currentPath", currentPath); + super.onSaveInstanceState(outState); + } + }