Fixed issue with selection in LIstView

This commit is contained in:
unknown 2014-06-20 12:45:57 +03:00
parent bc67cf7878
commit 11e6cad25e
3 changed files with 5 additions and 3 deletions

View file

@ -24,6 +24,7 @@
<ListView android:id="@android:id/list" <ListView android:id="@android:id/list"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:layout_height="fill_parent"
android:choiceMode="singleChoice"
style="@style/OsmandListView"/> style="@style/OsmandListView"/>

View file

@ -131,6 +131,7 @@ public class RoutePointsActivity extends OsmandListActivity {
super.onListItemClick(l, v, position, id); super.onListItemClick(l, v, position, id);
RoutePoint rp = adapter.getItem(position); RoutePoint rp = adapter.getItem(position);
getSherlock().startActionMode(getPointActionModeCallback(rp)); getSherlock().startActionMode(getPointActionModeCallback(rp));
adapter.notifyDataSetChanged();
} }
private class PointItemAdapter extends ArrayAdapter<RoutePoint> { private class PointItemAdapter extends ArrayAdapter<RoutePoint> {
@ -239,7 +240,7 @@ public class RoutePointsActivity extends OsmandListActivity {
@Override @Override
public void onDestroyActionMode(ActionMode actionMode) { public void onDestroyActionMode(ActionMode actionMode) {
adapter.notifyDataSetChanged();
} }
}; };
@ -287,6 +288,7 @@ public class RoutePointsActivity extends OsmandListActivity {
@Override @Override
public void onDestroyActionMode(ActionMode actionMode) { public void onDestroyActionMode(ActionMode actionMode) {
selectedItem = null; selectedItem = null;
adapter.notifyDataSetChanged();
} }
}; };
} }

View file

@ -101,7 +101,6 @@ public class RoutePointsPlugin extends OsmandPlugin {
@Override @Override
public void updateLayers(OsmandMapTileView mapView, MapActivity activity) { public void updateLayers(OsmandMapTileView mapView, MapActivity activity) {
if (routeStepsControl == null) { if (routeStepsControl == null) {
registerWidget(activity); registerWidget(activity);
} }