Fixed file opening.

This commit is contained in:
Iain Billett
2012-06-22 21:27:36 +01:00
parent cdea32dd8a
commit a84eb85c35
2 changed files with 22 additions and 1 deletions

View File

@@ -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:

View File

@@ -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