[Libreoffice-commits] .: android/experimental

Iain Billett iainb at kemper.freedesktop.org
Fri Jun 22 13:28:57 PDT 2012


 android/experimental/DocumentLoader/src/org/libreoffice/android/examples/DocumentLoader.java |   19 ++++++++++
 android/experimental/LibreOffice4Android/src/org/libreoffice/ui/LibreOfficeUIActivity.java   |    4 +-
 2 files changed, 22 insertions(+), 1 deletion(-)

New commits:
commit a84eb85c3575d5b6f79717904b6d55848bc2e84c
Author: Iain Billett <iainbillett at gmail.com>
Date:   Fri Jun 22 21:27:36 2012 +0100

    Fixed file opening.

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 cf042a4..50e8a06 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 bdf2c53..0f31f19 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


More information about the Libreoffice-commits mailing list