diff options
author | Siqi Liu <me@siqi.fr> | 2015-04-23 15:22:31 +0200 |
---|---|---|
committer | Siqi Liu <me@siqi.fr> | 2015-04-23 15:31:17 +0200 |
commit | f265344c4d1e0262814d4a5498bf7035f15ccb48 (patch) | |
tree | 1632dfb7c9fa0e302a72ec7379de61e3e6757735 | |
parent | 6c03914e2b762e0ba103eb7cb0ab9bf6203d2305 (diff) |
intent preference overrides default prefs.
Change-Id: I315d283f6c000d971421a098264e9c594930283e
-rw-r--r-- | android/experimental/LOAndroid3/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java index fd085747d417..938a2599e1cf 100644 --- a/android/experimental/LOAndroid3/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java +++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java @@ -501,6 +501,27 @@ public class LibreOfficeUIActivity extends ActionBarActivity implements ActionBa sortMode = prefs.getInt(SORT_MODE_KEY, FileUtilities.SORT_AZ); SharedPreferences defaultPrefs = PreferenceManager.getDefaultSharedPreferences(getBaseContext()); filterMode = Integer.valueOf(defaultPrefs.getString(FILTER_MODE_KEY , "-1")); + + Intent i = this.getIntent(); + if (i.hasExtra(CURRENT_DIRECTORY_KEY)) { + try { + currentDirectory = documentProvider.createFromUri(new URI( + i.getStringExtra(CURRENT_DIRECTORY_KEY))); + } catch (URISyntaxException e) { + currentDirectory = documentProvider.getRootDirectory(); + } + Log.d(LOGTAG, CURRENT_DIRECTORY_KEY); + } + + if (i.hasExtra(FILTER_MODE_KEY)) { + filterMode = i.getIntExtra( FILTER_MODE_KEY, FileUtilities.ALL); + Log.d(LOGTAG, FILTER_MODE_KEY); + } + + if (i.hasExtra(EXPLORER_VIEW_TYPE_KEY)) { + viewMode = i.getIntExtra( EXPLORER_VIEW_TYPE_KEY, GRID_VIEW); + Log.d(LOGTAG, EXPLORER_VIEW_TYPE_KEY); + } } @Override |