package net.sf.openrocket.android;\r
\r
import net.sf.openrocket.R;\r
+import net.sf.openrocket.android.filebrowser.SimpleFileBrowser;\r
import net.sf.openrocket.android.motor.MotorHierarchicalBrowser;\r
import android.app.Activity;\r
+import android.content.ActivityNotFoundException;\r
import android.content.Intent;\r
import android.net.Uri;\r
import android.os.Bundle;\r
import android.view.View;\r
-import android.view.Window;\r
\r
public class Main extends Activity {\r
\r
}\r
\r
public void pickOrkFiles( View v ) {\r
- Intent intent = new Intent(Intent.ACTION_GET_CONTENT);\r
- intent.setType("file/*");\r
- startActivityForResult(intent,PICK_ORK_FILE_RESULT);\r
+ try {\r
+ Intent intent = new Intent(Intent.ACTION_GET_CONTENT);\r
+ intent.setType("file/*");\r
+ startActivityForResult(intent,PICK_ORK_FILE_RESULT);\r
+ } catch ( ActivityNotFoundException ex ) { \r
+ // No activity for ACTION_GET_CONTENT use internal file browser\r
+ Intent intent = new Intent(Main.this, SimpleFileBrowser.class);\r
+ startActivityForResult(intent,PICK_ORK_FILE_RESULT);\r
+ }\r
}\r
\r
public void browseMotors( View v ) {\r