1 package net.sf.openrocket.android;
\r
3 import net.sf.openrocket.R;
\r
4 import net.sf.openrocket.android.motor.MotorHierarchicalBrowser;
\r
5 import android.app.Activity;
\r
6 import android.content.Intent;
\r
7 import android.net.Uri;
\r
8 import android.os.Bundle;
\r
9 import android.view.View;
\r
10 import android.view.Window;
\r
12 public class Main extends Activity {
\r
14 private static final int PICK_ORK_FILE_RESULT = 1;
\r
16 /** Called when the activity is first created. */
\r
18 public void onCreate(Bundle icicle) {
\r
19 super.onCreate(icicle);
\r
20 setContentView(R.layout.main);
\r
24 * @see android.app.Activity#onActivityResult(int, int, android.content.Intent)
\r
27 protected void onActivityResult(int requestCode, int resultCode, Intent data) {
\r
28 switch ( requestCode ) {
\r
29 case PICK_ORK_FILE_RESULT:
\r
30 if(resultCode==RESULT_OK){
\r
31 Uri file = data.getData();
\r
32 Intent intent = new Intent(Intent.ACTION_VIEW);
\r
33 intent.setData(file);
\r
34 startActivity(intent);
\r
38 super.onActivityResult(requestCode, resultCode, data);
\r
41 public void pickOrkFiles( View v ) {
\r
42 Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
\r
43 intent.setType("file/*");
\r
44 startActivityForResult(intent,PICK_ORK_FILE_RESULT);
\r
47 public void browseMotors( View v ) {
\r
48 Intent i = new Intent(Main.this, MotorHierarchicalBrowser.class);
\r