Java Reference
In-Depth Information
public void destroyApp(boolean unconditional) {
if (fetcher!=null) fetcher.cancel();
fetcher = null;
}
public void update() {
get_wxItem().setText(get_forecast());
try
{
locationStore.updateLocation(location);
}
catch(Exception e){}
fetcher = null;
}
public void commandAction(Command command, Displayable displayable) {
// Insert global pre-action code here
if (displayable == wxForm) {
if (command == exitCommand) {
exitMIDlet();
} else if (command == settingCommand) {
getDisplay().setCurrent(get_locationList());
}
} else if (displayable == locationList) {
if (command == screenCommand) {
getDisplay().setCurrent(get_locationTextBox());
} else if (command == List.SELECT_COMMAND) {
int index = get_locationList().getSelectedIndex();
set_location(get_locationList().getString(index));
if (fetcher != null) fetcher.cancel();
fetcher = new WeatherFetcher(location, this);
getDisplay().setCurrent(get_wxForm());
} else if (command == backCommand) {
getDisplay().setCurrent(get_wxForm());
}
} else if (displayable == locationTextBox) {
if (command == backCommand) {
getDisplay().setCurrent(get_locationList());
} else if (command == okCommand) {
add_location(locationTextBox.getString());
getDisplay().setCurrent(get_locationList());
}
 
Search WWH ::




Custom Search