736a9074c6f4614c73d4df5cba593a3bb952be8c
[android_pandora.git] /
1 package org.openintents.filemanager;\r
2 \r
3 import android.app.Dialog;\r
4 import android.app.ListActivity;\r
5 import android.os.Bundle;\r
6 import android.view.Menu;\r
7 import android.view.MenuItem;\r
8 \r
9 public class DistributionLibraryListActivity extends ListActivity {\r
10 \r
11         protected static final int MENU_DISTRIBUTION_START = Menu.FIRST;\r
12         \r
13         protected static final int DIALOG_DISTRIBUTION_START = 1;\r
14 \r
15         protected DistributionLibrary mDistribution;\r
16 \r
17     /** Called when the activity is first created. */\r
18     @Override\r
19     protected void onCreate(Bundle savedInstanceState) {\r
20         super.onCreate(savedInstanceState);\r
21         \r
22         mDistribution = new DistributionLibrary(this, MENU_DISTRIBUTION_START, DIALOG_DISTRIBUTION_START);\r
23     }\r
24 \r
25         @Override\r
26         public boolean onCreateOptionsMenu(Menu menu) {\r
27                 super.onCreateOptionsMenu(menu);\r
28                 mDistribution.onCreateOptionsMenu(menu);\r
29                 return true;\r
30         }\r
31 \r
32         @Override\r
33         public boolean onOptionsItemSelected(MenuItem item) {\r
34                 if (mDistribution.onOptionsItemSelected(item)) {\r
35                         return true;\r
36                 }\r
37                 return super.onOptionsItemSelected(item);\r
38         }\r
39 \r
40         @Override\r
41         protected Dialog onCreateDialog(int id) {\r
42                 return mDistribution.onCreateDialog(id);\r
43         }\r
44 \r
45         @Override\r
46         protected void onPrepareDialog(int id, Dialog dialog) {\r
47                 super.onPrepareDialog(id, dialog);\r
48                 mDistribution.onPrepareDialog(id, dialog);\r
49         }\r
50 }\r