Date: Sun, 17 Jun 2012 05:56:11 -0700
From: entre...@gmail.com
To: android-developers@googlegroups.com
Subject: Re: [android-developers] Long press on the Google map secret?
Please, see my code. I speak that method onLongClick does not work. why does
not code work, i can not understand
public class MainItemizedOverlay extends ItemizedOverlay<OverlayItem>
implements OnLongClickListener{ private ArrayList<OverlayItem> mOverlayItems;
public MainItemizedOverlay(Drawable defaultMarker) {
super(boundCenterBottom(defaultMarker)); mOverlayItems = new
ArrayList<OverlayItem>(); populate();
}
public void addNewItem(GeoPoint location, String markerText, String
snippet) { mOverlayItems.add(new OverlayItem(location, markerText,
markerText)); populate(); }
public void removeItem(int index) {
mOverlayItems.remove(index); populate(); }
@Override protected OverlayItem createItem(int index) {
return mOverlayItems.get(index); }
@Override public int size() { return
mOverlayItems.size(); }
@Override public boolean onTouchEvent(MotionEvent event, MapView
mapView) { switch (event.getAction()) { case
MotionEvent.ACTION_DOWN: Log.i(MainMap.TAG, "Work");
break; case MotionEvent.ACTION_MOVE:
Log.i(MainMap.TAG, "Work"); break; case
MotionEvent.ACTION_UP: Log.i(MainMap.TAG, "Work");
break;
case MotionEvent.ACTION_CANCEL:
Log.i(MainMap.TAG, "Work"); break;
default: break; }
return super.onTouchEvent(event, mapView); }
public boolean onLongClick(View v) { Log.i(MainMap.TAG, "Do
not Work!! Why????"); return true; }}
воскресенье, 17 июня 2012 г., 7:34:10 UTC+3 пользователь Ibrahim написал:There
is a method called onlongClick listener ...apply that method...
it may help you..
On 16 June 2012 21:01, Andrei <entre...@gmail.com> wrote:
Hello. For several days now can't find a solution how to handle a long press on
Google map. I found a few detours:
1) Add GestureDetector as an overlay on the map 2) Do the calculation and
determine a long time. But I don't understand why is not working
OnLongClickListener if I ask for mapView, or define it in the class inherited
from the ItemizedOverlay<OverlayItem>. Method onTouch works fine, but why
didn't it work onLongClick
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en