diff options
| author | Arne Schwabe <arne@rfc2549.org> | 2014-05-20 23:16:21 +0200 |
|---|---|---|
| committer | Arne Schwabe <arne@rfc2549.org> | 2014-05-20 23:18:43 +0200 |
| commit | a8ace2cabf632d61ba544639301b937a824aef7a (patch) | |
| tree | e4915d14ea893937c34f659fe1dc3dfb67f2f754 /main/src/cgeo/geocaching/EditWaypointActivity.java | |
| parent | bc175b134809716d735b25a656ca3692b524b0fb (diff) | |
| download | cgeo-a8ace2cabf632d61ba544639301b937a824aef7a.zip cgeo-a8ace2cabf632d61ba544639301b937a824aef7a.tar.gz cgeo-a8ace2cabf632d61ba544639301b937a824aef7a.tar.bz2 | |
Make Fragment implementation more conforming to the coding guidelines. Fixes crash on rotation
Diffstat (limited to 'main/src/cgeo/geocaching/EditWaypointActivity.java')
| -rw-r--r-- | main/src/cgeo/geocaching/EditWaypointActivity.java | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/main/src/cgeo/geocaching/EditWaypointActivity.java b/main/src/cgeo/geocaching/EditWaypointActivity.java index 279dbd5..8c060e5 100644 --- a/main/src/cgeo/geocaching/EditWaypointActivity.java +++ b/main/src/cgeo/geocaching/EditWaypointActivity.java @@ -48,7 +48,7 @@ import java.util.EnumSet; import java.util.List; @EActivity -public class EditWaypointActivity extends AbstractActionBarActivity { +public class EditWaypointActivity extends AbstractActionBarActivity implements CoordinatesInputDialog.CoordinateUpdate { private static final ArrayList<WaypointType> POSSIBLE_WAYPOINT_TYPES = new ArrayList<WaypointType>(WaypointType.ALL_TYPES_EXCEPT_OWN_AND_ORIGINAL); @ViewById(R.id.buttonLatitude) protected Button buttonLat; @@ -294,17 +294,18 @@ public class EditWaypointActivity extends AbstractActionBarActivity { // button text is blank when creating new waypoint } Geocache cache = DataStore.loadCache(geocode, LoadFlags.LOAD_WAYPOINTS); - CoordinatesInputDialog coordsDialog = new CoordinatesInputDialog(cache, gp, app.currentGeo()); + CoordinatesInputDialog coordsDialog = CoordinatesInputDialog.getInstance(cache, gp, app.currentGeo()); coordsDialog.setCancelable(true); - coordsDialog.setOnCoordinateUpdate(new CoordinatesInputDialog.CoordinateUpdate() { - @Override - public void update(final Geopoint gp) { - buttonLat.setText(gp.format(GeopointFormatter.Format.LAT_DECMINUTE)); - buttonLon.setText(gp.format(GeopointFormatter.Format.LON_DECMINUTE)); - } - }); coordsDialog.show(getSupportFragmentManager(),"wpeditdialog"); } + + + } + + @Override + public void updateCoordinates(Geopoint gp) { + buttonLat.setText(gp.format(GeopointFormatter.Format.LAT_DECMINUTE)); + buttonLon.setText(gp.format(GeopointFormatter.Format.LON_DECMINUTE)); } public static final int SUCCESS = 0; |
