diff options
author | Iain Billett <iainbillett@gmail.com> | 2012-06-22 21:27:36 +0100 |
---|---|---|
committer | Iain Billett <iainbillett@gmail.com> | 2012-06-22 21:28:50 +0100 |
commit | a84eb85c3575d5b6f79717904b6d55848bc2e84c (patch) | |
tree | 4da863c8f2213560e6db63d74e326581cd6f7db0 | |
parent | cdea32dd8a03fe5375eaef785461170cdee10622 (diff) |
Fixed file opening.
2 files changed, 22 insertions, 1 deletions
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 cf042a426421..50e8a0669b26 100644 --- a/android/experimental/DocumentLoader/src/org/libreoffice/android/examples/DocumentLoader.java +++ b/android/experimental/DocumentLoader/src/org/libreoffice/android/examples/DocumentLoader.java @@ -102,6 +102,8 @@ public class DocumentLoader ViewGroup.LayoutParams matchParent; ViewFlipper flipper; + + Bundle extras; class GestureListener extends GestureDetector.SimpleOnGestureListener @@ -510,6 +512,8 @@ public class DocumentLoader { super.onCreate(savedInstanceState); + extras = getIntent().getExtras(); + gestureDetector = new GestureDetector(this, new GestureListener()); try { @@ -591,6 +595,21 @@ public class DocumentLoader { return gestureDetector.onTouchEvent(event); } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + switch (item.getItemId()) { + case android.R.id.home: + // app icon in action bar clicked; go home + Intent intent = new Intent(this, LibreOfficeUIActivity.class); + intent.putExtras( extras ); + //intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); + startActivity(intent); + return true; + default: + return super.onOptionsItemSelected(item); + } + } } // vim:set shiftwidth=4 softtabstop=4 expandtab: diff --git a/android/experimental/LibreOffice4Android/src/org/libreoffice/ui/LibreOfficeUIActivity.java b/android/experimental/LibreOffice4Android/src/org/libreoffice/ui/LibreOfficeUIActivity.java index bdf2c53ed283..0f31f199a088 100644 --- a/android/experimental/LibreOffice4Android/src/org/libreoffice/ui/LibreOfficeUIActivity.java +++ b/android/experimental/LibreOffice4Android/src/org/libreoffice/ui/LibreOfficeUIActivity.java @@ -167,7 +167,9 @@ public class LibreOfficeUIActivity extends Activity implements OnNavigationListe i.putExtra( EXPLORER_VIEW_TYPE_KEY , viewMode ); startActivity( i ); */ - startActivity( new Intent( this , DocumentLoader.class ) ); + Intent i = new Intent( this , DocumentLoader.class ); + i.putExtra("input",new File( currentDirectory , file).getAbsolutePath() ); + startActivity( i ); } @Override |