0

I am trying to linkify a phone number within a snippet of a google map. Given this code:

import com.google.android.gms.maps.*;
import com.google.android.gms.maps.model.*;
import android.app.Activity;
import android.os.Bundle;

public class MapPane extends Activity implements OnMapReadyCallback {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.map_activity);

        MapFragment mapFragment = (MapFragment) getFragmentManager()
                .findFragmentById(R.id.map);
        mapFragment.getMapAsync(this);
    }

    @Override
    public void onMapReady(GoogleMap map) {
        LatLng sydney = new LatLng(-33.867, 151.206);

        map.setMyLocationEnabled(true);
        map.moveCamera(CameraUpdateFactory.newLatLngZoom(sydney, 13));

        map.addMarker(new MarkerOptions()
                .title("Sydney")
                .snippet("1-800-555-5555")
                .position(sydney));
    }
}

How could I make thie snippet:

.snippet("1-800-555-5555")

Linkified, so if they click the marker, then click the phone number in the resulting snippet popup, Android will call that number?

MrUpsidown
  • 21,592
  • 15
  • 77
  • 131
user1625155
  • 501
  • 1
  • 8
  • 15
  • I doubt that's possible. When you create your own `InfoWindowAdapter`, the `View` you return for the popup is converted into a bitmap, and the bitmap, not the `View`, is what's shown. Hence, interactive elements in the `View` are pointless. I assume that the default "info window" popups are created the same way. – CommonsWare Nov 10 '15 at 23:51
  • I didn't know that InfoWindows are converted to a bitmap, very interesting. @user what you could do is make the phone number styled like a link (blue and underlined), and then implement an InfoWindow click listener. – Daniel Nugent Nov 10 '15 at 23:58

0 Answers0