diff options
Diffstat (limited to 'main/src/cgeo/geocaching/LogTrackableActivity.java')
| -rw-r--r-- | main/src/cgeo/geocaching/LogTrackableActivity.java | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/main/src/cgeo/geocaching/LogTrackableActivity.java b/main/src/cgeo/geocaching/LogTrackableActivity.java index 4ddec72..b8983ba 100644 --- a/main/src/cgeo/geocaching/LogTrackableActivity.java +++ b/main/src/cgeo/geocaching/LogTrackableActivity.java @@ -7,8 +7,8 @@ import cgeo.geocaching.enumerations.StatusCode; import cgeo.geocaching.network.Network; import cgeo.geocaching.network.Parameters; import cgeo.geocaching.twitter.Twitter; -import cgeo.geocaching.ui.DateDialog; import cgeo.geocaching.ui.Formatter; +import cgeo.geocaching.ui.dialog.DateDialog; import cgeo.geocaching.utils.Log; import cgeo.geocaching.utils.LogTemplateProvider.LogContext; @@ -47,7 +47,7 @@ public class LogTrackableActivity extends AbstractLoggingActivity implements Dat private int attempts = 0; private CheckBox tweetCheck = null; private LinearLayout tweetBox = null; - private cgTrackable trackable; + private Trackable trackable; private Handler showProgressHandler = new Handler() { @Override @@ -119,20 +119,20 @@ public class LogTrackableActivity extends AbstractLoggingActivity implements Dat // get parameters final Bundle extras = getIntent().getExtras(); if (extras != null) { - geocode = extras.getString("geocode"); - guid = extras.getString("guid"); + geocode = extras.getString(Intents.EXTRA_GEOCODE); + guid = extras.getString(Intents.EXTRA_GUID); - if (StringUtils.isNotBlank(extras.getString("trackingcode"))) { - ((EditText) findViewById(R.id.tracking)).setText(extras.getString("trackingcode")); + if (StringUtils.isNotBlank(extras.getString(Intents.EXTRA_TRACKING_CODE))) { + ((EditText) findViewById(R.id.tracking)).setText(extras.getString(Intents.EXTRA_TRACKING_CODE)); } } - trackable = app.getTrackableByGeocode(geocode); + trackable = cgData.loadTrackable(geocode); if (StringUtils.isNotBlank(trackable.getName())) { setTitle(res.getString(R.string.trackable_touch) + ": " + trackable.getName()); } else { - setTitle(res.getString(R.string.trackable_touch) + ": " + trackable.getGeocode().toUpperCase()); + setTitle(res.getString(R.string.trackable_touch) + ": " + trackable.getGeocode()); } if (guid == null) { @@ -207,7 +207,7 @@ public class LogTrackableActivity extends AbstractLoggingActivity implements Dat tweetCheck.setChecked(true); if (CollectionUtils.isEmpty(possibleLogTypes)) { - possibleLogTypes = cgTrackable.getPossibleLogTypes(); + possibleLogTypes = Trackable.getPossibleLogTypes(); } final Button buttonPost = (Button) findViewById(R.id.post); @@ -311,7 +311,7 @@ public class LogTrackableActivity extends AbstractLoggingActivity implements Dat possibleLogTypes.addAll(typesPre); } } catch (Exception e) { - Log.e("LogTrackableActivity.LoadDataThread.run: " + e.toString()); + Log.e("LogTrackableActivity.LoadDataThread.run", e); } loadDataHandler.sendEmptyMessage(0); @@ -349,17 +349,17 @@ public class LogTrackableActivity extends AbstractLoggingActivity implements Dat return status; } catch (Exception e) { - Log.e("LogTrackableActivity.postLogFn: " + e.toString()); + Log.e("LogTrackableActivity.postLogFn", e); } return StatusCode.LOG_POST_ERROR; } - public static void startActivity(final Context context, final cgTrackable trackable) { + public static void startActivity(final Context context, final Trackable trackable) { final Intent logTouchIntent = new Intent(context, LogTrackableActivity.class); - logTouchIntent.putExtra("geocode", trackable.getGeocode().toUpperCase()); - logTouchIntent.putExtra("guid", trackable.getGuid()); - logTouchIntent.putExtra("trackingcode", trackable.getTrackingcode()); + logTouchIntent.putExtra(Intents.EXTRA_GEOCODE, trackable.getGeocode()); + logTouchIntent.putExtra(Intents.EXTRA_GUID, trackable.getGuid()); + logTouchIntent.putExtra(Intents.EXTRA_TRACKING_CODE, trackable.getTrackingcode()); context.startActivity(logTouchIntent); } |
