Back to project page openmbta-android.
The source code is released under:
Copyright (c) 2014 Kaja Software Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal...
If you think the Android project openmbta-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.kaja.openmbta; //from www. j a v a2 s. c o m import android.content.Context; import android.graphics.drawable.Drawable; import android.location.Location; import com.google.android.maps.GeoPoint; import com.google.android.maps.ItemizedOverlay; import com.google.android.maps.OverlayItem; import java.util.ArrayList; import android.app.AlertDialog; public class RoutesItemizedOverlay extends ItemizedOverlay<OverlayItem>{ private ArrayList<OverlayItem> mOverlays = new ArrayList<OverlayItem>(); private Context mContext; public RoutesItemizedOverlay(Drawable defaultMarker, Context context) { //super(defaultMarker); super(boundCenterBottom(defaultMarker)); mContext = context; populate(); } public RoutesItemizedOverlay(Drawable defaultMarker) { super(boundCenterBottom(defaultMarker)); //this.location = loc; populate(); } public void addOverlay(OverlayItem overlay) { mOverlays.add(overlay); populate(); } @Override protected OverlayItem createItem(int i) { return mOverlays.get(i); } @Override public int size() { return mOverlays.size(); } @Override protected boolean onTap(int index) { OverlayItem item = mOverlays.get(index); AlertDialog.Builder dialog = new AlertDialog.Builder(mContext); dialog.setTitle(item.getTitle()); dialog.setMessage(item.getSnippet()); dialog.show(); return true; } }