Issue 493: Fix remaining annoying bug with wrong position caching

This commit is contained in:
sonora 2011-12-28 16:47:47 +01:00
parent a5c3ad6088
commit 271fb09690

View file

@ -482,7 +482,8 @@ public class MapActivity extends Activity implements IMapLocationListener, Senso
LatLon loc = getMapLocation(); LatLon loc = getMapLocation();
search.putExtra(SearchActivity.SEARCH_LAT, loc.getLatitude()); search.putExtra(SearchActivity.SEARCH_LAT, loc.getLatitude());
search.putExtra(SearchActivity.SEARCH_LON, loc.getLongitude()); search.putExtra(SearchActivity.SEARCH_LON, loc.getLongitude());
search.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); // causes wrong position caching: search.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
search.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
MapActivity.this.startActivity(search); MapActivity.this.startActivity(search);
dlg.dismiss(); dlg.dismiss();
} }
@ -505,11 +506,12 @@ public class MapActivity extends Activity implements IMapLocationListener, Senso
public boolean onKeyDown(int keyCode, KeyEvent event) { public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_SEARCH && event.getRepeatCount() == 0) { if (keyCode == KeyEvent.KEYCODE_SEARCH && event.getRepeatCount() == 0) {
Intent newIntent = new Intent(MapActivity.this, SearchActivity.class); Intent newIntent = new Intent(MapActivity.this, SearchActivity.class);
newIntent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); // causes wrong position caching: newIntent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
LatLon loc = getMapLocation(); LatLon loc = getMapLocation();
newIntent.putExtra(SearchActivity.SEARCH_LAT, loc.getLatitude()); newIntent.putExtra(SearchActivity.SEARCH_LAT, loc.getLatitude());
newIntent.putExtra(SearchActivity.SEARCH_LON, loc.getLongitude()); newIntent.putExtra(SearchActivity.SEARCH_LON, loc.getLongitude());
startActivity(newIntent); startActivity(newIntent);
newIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
return true; return true;
} else if (!routingHelper.isFollowingMode()) { } else if (!routingHelper.isFollowingMode()) {
if (keyCode == KeyEvent.KEYCODE_VOLUME_UP && event.getRepeatCount() == 0) { if (keyCode == KeyEvent.KEYCODE_VOLUME_UP && event.getRepeatCount() == 0) {
@ -1082,10 +1084,11 @@ public class MapActivity extends Activity implements IMapLocationListener, Senso
// NavigatePointActivity dlg = new NavigatePointActivity(this); // NavigatePointActivity dlg = new NavigatePointActivity(this);
// dlg.showDialog(); // dlg.showDialog();
Intent newIntent = new Intent(MapActivity.this, SearchActivity.class); Intent newIntent = new Intent(MapActivity.this, SearchActivity.class);
newIntent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); // causes wrong position caching: newIntent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
LatLon mapLoc = getMapLocation(); LatLon mapLoc = getMapLocation();
newIntent.putExtra(SearchActivity.SEARCH_LAT, mapLoc.getLatitude()); newIntent.putExtra(SearchActivity.SEARCH_LAT, mapLoc.getLatitude());
newIntent.putExtra(SearchActivity.SEARCH_LON, mapLoc.getLongitude()); newIntent.putExtra(SearchActivity.SEARCH_LON, mapLoc.getLongitude());
newIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(newIntent); startActivity(newIntent);
return true; return true;
case R.id.map_mute: case R.id.map_mute: