From af3382e8268698a8ba7a9451b508109f84cb375e Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Mon, 6 Feb 2012 00:56:36 +0100 Subject: [PATCH] Fix short click --- .../plus/activities/LocalOpenstreetmapActivity.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/OsmAnd/src/net/osmand/plus/activities/LocalOpenstreetmapActivity.java b/OsmAnd/src/net/osmand/plus/activities/LocalOpenstreetmapActivity.java index 9da725b328..3d8506e946 100644 --- a/OsmAnd/src/net/osmand/plus/activities/LocalOpenstreetmapActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/LocalOpenstreetmapActivity.java @@ -17,6 +17,7 @@ import android.view.ContextMenu.ContextMenuInfo; import android.widget.BaseExpandableListAdapter; import android.widget.ExpandableListView; import android.widget.ExpandableListView.ExpandableListContextMenuInfo; +import android.widget.ExpandableListView.OnChildClickListener; import android.widget.TextView; import android.widget.Toast; @@ -59,6 +60,15 @@ public class LocalOpenstreetmapActivity extends ExpandableListActivity { setContentView(R.layout.local_openstreetmap); listAdapter = new LocalOpenstreetmapAdapter(); + getExpandableListView().setOnChildClickListener(new OnChildClickListener() { + + @Override + public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) { + final OpenstreetmapPoint point = (OpenstreetmapPoint) listAdapter.getChild(groupPosition, childPosition); + showContextMenu(point); + return true; + } + }); getExpandableListView().setOnCreateContextMenuListener(new View.OnCreateContextMenuListener() { @Override public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {