Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
212 | ligi | 1 | |
2 | package org.ligi.android; |
||
3 | |||
4 | import android.app.ListActivity; |
||
5 | import android.content.Intent; |
||
6 | import android.content.pm.PackageManager; |
||
7 | import android.content.pm.ResolveInfo; |
||
8 | import android.os.Bundle; |
||
9 | import android.view.View; |
||
10 | import android.widget.ListView; |
||
11 | import android.widget.SimpleAdapter; |
||
12 | |||
13 | |||
14 | import android.util.Log; |
||
15 | import android.view.ViewGroup.*; |
||
16 | import android.app.Activity; |
||
17 | import android.os.Bundle; |
||
18 | |||
19 | |||
20 | import android.view.*; |
||
21 | import android.widget.*; |
||
22 | |||
23 | |||
24 | import java.text.Collator; |
||
25 | import java.util.ArrayList; |
||
26 | import java.util.Collections; |
||
27 | import java.util.Comparator; |
||
28 | import java.util.HashMap; |
||
29 | import java.util.List; |
||
30 | import java.util.Map; |
||
31 | import android.net.Uri; |
||
32 | |||
33 | import java.net.URISyntaxException; |
||
34 | import android.widget.ArrayAdapter; |
||
35 | |||
36 | |||
37 | import android.text.method.NumberKeyListener; |
||
38 | |||
39 | |||
40 | import com.google.android.maps.MapView; |
||
41 | |||
42 | import android.app.AlertDialog.*; |
||
43 | import android.app.AlertDialog; |
||
44 | |||
45 | import android.content.*; |
||
46 | |||
47 | import org.ligi.ufo.*; |
||
48 | |||
49 | public class FlightSettingsSettingSelect extends ListActivity |
||
50 | { |
||
51 | |||
52 | // String[] menu_items = new String[]{"Stick","Navi"}; |
||
53 | |||
54 | |||
55 | @Override |
||
56 | protected void onCreate(Bundle savedInstanceState) { |
||
57 | |||
58 | Bundle extras = getIntent().getExtras(); |
||
59 | |||
60 | // Bundle extras = intent.getExtras(); |
||
61 | |||
62 | String[] menu_items=extras.getStringArray("items"); |
||
63 | super.onCreate(savedInstanceState); |
||
64 | //setContentView(R.layout.motortest); |
||
65 | |||
66 | this.setListAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, menu_items)); |
||
67 | |||
68 | // setContentView(list_act); |
||
69 | |||
70 | |||
71 | } |
||
72 | |||
73 | @Override |
||
74 | protected void onListItemClick(ListView l, View v, int position, long id){ |
||
75 | super.onListItemClick(l, v, position, id); |
||
76 | |||
77 | // Get the item that was clicked |
||
78 | Object o = this.getListAdapter().getItem(position); |
||
79 | //String keyword = o.toString(); |
||
80 | |||
81 | |||
82 | Intent mIntent = new Intent(); |
||
83 | mIntent.putExtra("pos",position); |
||
84 | setResult(RESULT_OK, mIntent); |
||
85 | finish(); |
||
86 | |||
87 | |||
88 | |||
89 | // Create an VIEW intent |
||
90 | try { |
||
91 | switch(position) |
||
92 | { |
||
93 | |||
94 | case 0: |
||
95 | /* |
||
96 | // ListActivity Lis= new ListActivity(this); |
||
97 | is_list=false; |
||
98 | LinearLayout lin = new LinearLayout(this); |
||
99 | lin.setOrientation(LinearLayout.VERTICAL); |
||
100 | |||
101 | LayoutParams params = new LinearLayout.LayoutParams( LinearLayout.LayoutParams.FILL_PARENT, LinearLayout.LayoutParams.FILL_PARENT); |
||
102 | TextView t1 = new TextView(this); |
||
103 | |||
104 | t1.setText("Here is the first textbox"); |
||
105 | lin.addView(t1, params); |
||
106 | |||
107 | setContentView(lin); |
||
108 | |||
109 | */ |
||
110 | break; |
||
111 | |||
112 | |||
113 | } |
||
114 | } catch (Exception e) { |
||
115 | e.printStackTrace(); |
||
116 | } |
||
117 | // Start the activity |
||
118 | |||
119 | } |
||
120 | |||
121 | |||
122 | } |