Fix short click
This commit is contained in:
parent
0bcbb6f5f1
commit
af3382e826
1 changed files with 10 additions and 0 deletions
|
@ -17,6 +17,7 @@ import android.view.ContextMenu.ContextMenuInfo;
|
||||||
import android.widget.BaseExpandableListAdapter;
|
import android.widget.BaseExpandableListAdapter;
|
||||||
import android.widget.ExpandableListView;
|
import android.widget.ExpandableListView;
|
||||||
import android.widget.ExpandableListView.ExpandableListContextMenuInfo;
|
import android.widget.ExpandableListView.ExpandableListContextMenuInfo;
|
||||||
|
import android.widget.ExpandableListView.OnChildClickListener;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
@ -59,6 +60,15 @@ public class LocalOpenstreetmapActivity extends ExpandableListActivity {
|
||||||
setContentView(R.layout.local_openstreetmap);
|
setContentView(R.layout.local_openstreetmap);
|
||||||
listAdapter = new LocalOpenstreetmapAdapter();
|
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() {
|
getExpandableListView().setOnCreateContextMenuListener(new View.OnCreateContextMenuListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
|
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
|
||||||
|
|
Loading…
Reference in a new issue