Better memory use. Reuse of screens.
--- a/src/horaris/HoraroTransporta.java Sun Jan 14 18:27:47 2007 +0100
+++ b/src/horaris/HoraroTransporta.java Sun Jan 14 20:05:40 2007 +0100
@@ -42,17 +42,6 @@
lokoj = radiko.getNode("Llocs");
sencoj = radiko.getNode("Sentits");
- try {
- show();
- } catch (Exception e)
- {
- System.err.println("Cannot create form: " + e);
- e.printStackTrace();
- }
- }
-
- public void show()
- {
myform = new Form("Cerca");
/* Items */
@@ -82,6 +71,13 @@
myform.addCommand(cmd_malantauxen);
myform.setCommandListener(this);
myform.setItemStateListener(this);
+
+ show();
+ }
+
+ public void show()
+ {
+ mytimelist = null;
Main.display.setCurrent(myform);
}
--- a/src/horaris/MainList.java Sun Jan 14 18:27:47 2007 +0100
+++ b/src/horaris/MainList.java Sun Jan 14 20:05:40 2007 +0100
@@ -19,10 +19,7 @@
{
main = _main;
loadList();
- }
- public void show()
- {
mylist = new List("Horaris", List.IMPLICIT);
/* Show the Titles (they're also in the hashtable) */
@@ -36,6 +33,10 @@
mylist.addCommand(cmd_about);
mylist.setCommandListener(this);
System.err.println("Setting screen");
+ }
+
+ public void show()
+ {
main.display.setCurrent(mylist);
}
--- a/src/horaris/TimeList.java Sun Jan 14 18:27:47 2007 +0100
+++ b/src/horaris/TimeList.java Sun Jan 14 20:05:40 2007 +0100
@@ -20,10 +20,6 @@
vtempoj = t;
hinfo = info;
last = _last;
- }
-
- public void show()
- {
mylist = new List("Sortida-Arribada", List.IMPLICIT);
for (int i=0; i < vtempoj.size(); i++)
@@ -33,6 +29,10 @@
mylist.addCommand(cmd_malantauxen);
mylist.setCommandListener(this);
+ }
+
+ public void show()
+ {
Main.display.setCurrent(mylist);
}