Fix short click

This commit is contained in:
Victor Shcherb 2012-02-06 00:56:36 +01:00
parent 0bcbb6f5f1
commit af3382e826

View file

@ -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) {