Trim favorite name

This commit is contained in:
Victor Shcherb 2013-08-03 23:52:17 +02:00
parent 4b5cf87d34
commit 5feaaa8485
2 changed files with 3 additions and 3 deletions

View file

@ -241,7 +241,7 @@ public class FavouritesActivity extends OsmandExpandableListActivity {
builder.setPositiveButton(R.string.default_buttons_apply, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
boolean editied = helper.editFavouriteName(point, editText.getText().toString(), cat.getText().toString());
boolean editied = helper.editFavouriteName(point, editText.getText().toString().trim(), cat.getText().toString());
if (editied) {
favouritesAdapter.synchronizeGroups();
favouritesAdapter.sort(favoritesComparator);

View file

@ -180,8 +180,8 @@ public class MapActivityActions implements DialogProvider {
public void onClick(DialogInterface dialog, int which) {
FavouritePoint point = (FavouritePoint) args.getSerializable(KEY_FAVORITE);
final FavouritesDbHelper helper = ((OsmandApplication) activity.getApplication()).getFavorites();
point.setName(editText.getText().toString());
point.setCategory(cat.getText().toString());
point.setName(editText.getText().toString().trim());
point.setCategory(cat.getText().toString().trim());
boolean added = helper.addFavourite(point);
if (added) {
AccessibleToast.makeText(activity, MessageFormat.format(