Troubleshooting guide
210
BlackBerry Java Development Environment Development Guide
}
/* Marks a point in the persistent store. Calculations are based on
* all data collected since the previous waypoint, or from the start
* of the application if no previous waypoints exist.
*/
private void markPoint() {
long current = System.currentTimeMillis();
WayPoint p= new WayPoint(_startTime, current, _wayHorizontalDistance,
_verticalDistance);
addWayPoint(p);
// Reset the waypoint variables.
_startTime = current;
_wayHorizontalDistance = 0;
_verticalDistance = 0;
}
/**
* View the various options for this application
*/
public void viewOptions()
{
OptionScreen optionScreen = new OptionScreen();
pushScreen(optionScreen);
}
// View the saved waypoints.
private void viewPreviousPoints() {
PointScreen pointScreen = new PointScreen(_previousPoints, _resources);
pushScreen(pointScreen);
}
/* Adds a new waypoint and commits the set of saved waypoints
* to flash memory.
* @param p The point to add.
*/
/*package*/ synchronized static void addWayPoint(WayPoint p) {
_previousPoints.addElement(p);
commit();
}
/* Removes a waypoint from the set of saved points and commits the modifed set to flash
memory.
* @param p the point to remove
*/
/*package*/ synchronized static void removeWayPoint(WayPoint p) {
_previousPoints.removeElement(p);
commit();
}
// Commit the waypoint set to flash memory.
private static void commit() {
_store.setContents(_previousPoints);
_store.commit();
}
/**