ZonePickerpublic class ZonePicker extends android.app.ListActivity
Fields Summary |
---|
private android.widget.ArrayAdapter | mFilterAdapter |
Methods Summary |
---|
protected void | addItem(java.util.List data, java.lang.String name, java.lang.String zone)
HashMap temp = new HashMap();
temp.put("title", name);
temp.put("zone", zone);
data.add(temp);
| protected void | onActivityResult(int requestCode, int resultCode, android.content.Intent data)
// If subactivity has resulted in a timezone selection, close this act.
if (resultCode == RESULT_OK) {
finish();
}
| public void | onCreate(android.os.Bundle icicle)
super.onCreate(icicle);
mFilterAdapter = ArrayAdapter.createFromResource(this,
R.array.timezone_filters, android.R.layout.simple_list_item_1);
setListAdapter(mFilterAdapter);
| protected void | onListItemClick(android.widget.ListView l, android.view.View v, int position, long id)
String filter = (String) mFilterAdapter.getItem(position);
// If All is chosen, reset the filter
if (filter.equals("All")) {
filter = null;
}
Intent zoneList = new Intent();
zoneList.setClass(this, ZoneList.class);
zoneList.putExtra("filter", filter);
startActivityForResult(zoneList, 0);
|
|