To be sure that you have some idea of what I am talking about, here is
the code for the entire class :
import java.util.ArrayList;
import android.graphics.drawable.Drawable;
import android.widget.Toast;
import com.google.android.maps.ItemizedOverlay;
import com.google.android.maps.OverlayItem;
public class HelloItemizedOverlay extends ItemizedOverlay {
private ArrayList<OverlayItem> mOverlays = new ArrayList<OverlayItem>
();
public HelloItemizedOverlay(Drawable defaultMarker) {
super(boundCenterBottom(defaultMarker));
}
@Override
protected OverlayItem createItem(int i) {
return mOverlays.get(i);
}
@Override
public int size() {
return mOverlays.size();
}
public void addOverlay(OverlayItem overlay) {
mOverlays.add(overlay);
populate();
}
protected boolean onTap(int index) {
Toast.makeText(HelloItemizedOverlay.this, "TEST",
Toast.LENGTH_SHORT).show();
return super.onTap(index);
}
}
On Nov 4, 10:52 am, furby <[email protected]> wrote:
> It underlines the "makeText" word and when I ask it for suggestions
> all it says is "Rename in file".....
>
> Which makes me wonder if, perhaps, "makeText' no longer exists in the
> Toast object?
>
> On Nov 4, 10:38 am, Mark Murphy <[email protected]> wrote:
>
> > furby wrote:
> > > So I am slowly trying to figure out maps... I want to be able to click
> > > on a point and pop up a message. Toast seemed the way to go. So I
> > > added an "onTap" handler in my class that extends ItemizedOverlay (the
> > > class is called HelloItemizedOverlay) and then tried to grab the Toast
> > > example... But I am seeing Eclipse tell me that the line is in error
> > > no matter what I do... My code is below - could someone tell me what i
> > > am doing wrong?
>
> > > protected boolean onTap(int index) {
> > > Toast.makeText(HelloItemizedOverlay.this, "TEST",
> > > Toast.LENGTH_SHORT).show();
> > > return super.onTap(index);
> > > }
>
> > And the error Eclipse gives you is...what?
>
> > --
> > Mark Murphy (a Commons
> > Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> > App Widgets Deep Dive Seminar, 27 January 2010:http://bit.ly/deepdive
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en