-1

Ich mache Code für Mapview, um Wegbeschreibungen zu erhalten, indem ich die beiden locations.suche, aber den Fehler für RoutingListener bekomme. Gibt es dafür eine JAR-Datei? Bitte gib mir Vorschläge. wo auch immer das Routing ist, bekomme ich Fehler. Bitte helfen Sie mir.Kann die Symbolklasse RoutingListener nicht auflösen

Vielen Dank im Voraus.

public class MapView2 extends AppCompatActivity implements RoutingListener, GoogleApiClient.OnConnectionFailedListener, GoogleApiClient.ConnectionCallbacks { 
protected GoogleMap map; 
protected LatLng start; 
protected LatLng end; 
@InjectView(R.id.start) 
AutoCompleteTextView starting; 
@InjectView(R.id.destination) 
AutoCompleteTextView destination; 
@InjectView(R.id.send) 
ImageView send; 
private static final String LOG_TAG = "MyActivity"; 
protected GoogleApiClient mGoogleApiClient; 
private PlaceAutoCompleteAdapter mAdapter; 
private ProgressDialog progressDialog; 
private ArrayList<Polyline> polylines; 
private static final int[] COLORS = new int[]{R.color.primary_dark, R.color.primary, R.color.primary_light, R.color.accent, R.color.primary_dark_material_light}; 


private static final LatLngBounds BOUNDS_JAMAICA = new LatLngBounds(new LatLng(-57.965341647205726, 144.9987719580531), 
     new LatLng(72.77492067739843, -9.998857788741589)); 

/** 
* This activity loads a map and then displays the route and pushpins on it. 
*/ 
@Override 
public void onCreate(Bundle savedInstanceState) { 
    super.onCreate(savedInstanceState); 
    setContentView(R.layout.activity_mapview2); 
    ButterKnife.inject(this); 
    getSupportActionBar().setDisplayShowHomeEnabled(true); 

    polylines = new ArrayList<>(); 
    mGoogleApiClient = new GoogleApiClient.Builder(this) 
      .addApi(Places.GEO_DATA_API) 
      .addConnectionCallbacks(this) 
      .addOnConnectionFailedListener(this) 
      .build(); 
    MapsInitializer.initialize(this); 
    mGoogleApiClient.connect(); 

    SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map); 

    if (mapFragment == null) { 
     mapFragment = SupportMapFragment.newInstance(); 
     getSupportFragmentManager().beginTransaction().replace(R.id.map, mapFragment).commit(); 
    } 
    map = mapFragment.getMap(); 

    mAdapter = new PlaceAutoCompleteAdapter(this, android.R.layout.simple_list_item_1, 
      mGoogleApiClient, BOUNDS_JAMAICA, null); 
+0

können Sie bitte Code hinzufügen? –

+0

ja ich bearbeite meine Frage – Mounika12

Antwort

1

Blick auf https://developers.google.com/maps/documentation/directions/

mit Absicht

Intent intent = new Intent(android.content.Intent.ACTION_VIEW, 
Uri.parse("http://maps.google.com/maps?saddr=xx.xx,xx.xx&daddr=xx.xx,xx.xx")); 
startActivity(intent); 
+0

Beispiel hier http://www.anddev.org/google_driving_directions_-_mapview_overlayed-t826.html –

+0

Ist Ihr Problem gelöst? –

+0

kein Fehler für RoutingListener, wo auch immer das Routing ist, es wird in roter Farbe angezeigt. – Mounika12

0

Sie benötigen RoutingListesner Schnittstelle zu erstellen.

Bitte überprüfen Sie this Link.

Weitere Informationen finden Sie im Projekt this.

+0

ok muss eine Schnittstelle von RoutingListener erstellen und dann – Mounika12

+0

hinzufügen, aber danach zeigt Rousingexception auch einen Fehler in der Schnittstelle – Mounika12

+0

können Sie Fehlerprotokoll setzen. –

Verwandte Themen