Fix crash (2)

This commit is contained in:
Alexander Sytnyk 2017-08-16 12:35:54 +03:00
parent 3fc71dd11c
commit dfeaa51292

View file

@ -74,6 +74,7 @@ public class MeasurementToolFragment extends Fragment {
public static final String TAG = "MeasurementToolFragment";
private final CommandManager commandManager = new CommandManager();
private List<WptPt> measurementPoints = new LinkedList<>();
private IconsCache iconsCache;
private RecyclerView pointsRv;
private MeasurementToolBarController toolBarController;
@ -104,8 +105,6 @@ public class MeasurementToolFragment extends Fragment {
private int positionToAddPoint = -1;
private List<WptPt> measurementPoints = new LinkedList<>();
public void setNewGpxLine(NewGpxLine newGpxLine) {
this.newGpxLine = newGpxLine;
}
@ -421,6 +420,12 @@ public class MeasurementToolFragment extends Fragment {
enterMeasurementMode();
// If rotate the screen from landscape to portrait when the list of points is displayed then
// the PointsListFragment will exist without view. This is necessary to remove it.
if (portrait) {
hidePointsListFragment();
}
if (newGpxLine != null && !routePointsAdded) {
LineType lineType = newGpxLine.getLineType();
if (lineType == LineType.ROUTE_POINTS) {