private static Intent createMapActivityIntent(Context context,URLSpan[] urlSpans){
  for (int span_i=0; span_i < urlSpans.length; span_i++) {
    URLSpan urlSpan=urlSpans[span_i];
    String urlString=urlSpan.getURL();
    if (urlString.startsWith(GEO_PREFIX)) {
      Intent geoIntent=new Intent(Intent.ACTION_VIEW,Uri.parse(urlString));
      geoIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
      return geoIntent;
    }
  }
  return null;
}

private static Intent createMapActivityIntent ( Context context , URLSpan [ ] urlSpans ) { for ( int span_i = 0 ; span_i < urlSpans . length ; span_i ++ ) { URLSpan urlSpan = urlSpans [ span_i ] ; String urlString = urlSpan . getURL ( ) ; if ( urlString . startsWith ( GEO_PREFIX ) ) { Intent geoIntent = new Intent ( Intent . ACTION_VIEW , Uri . parse ( urlString ) ) ; geoIntent . addFlags ( Intent . FLAG_ACTIVITY_NEW_TASK ) ; return geoIntent ; } } return null ; }
create an intent to take the user to maps , using the first map link available . if no links are found , return null .
