Hinzufügen PlaceAutocompleteFragment fragment wirft Fehler

Habe ich umgesetzt PlaceAutocompleteFragment in Tätigkeit und arbeitet erfolgreich. Aber, wie die Umsetzung der gleichen in fragment in android?
Ich habe umgesetzt placeautocomplete fragment wie dieses

 PlaceAutocompleteFragment autocompleteFragment1 = (PlaceAutocompleteFragment)
            getFragmentManager().findFragmentById(R.id.place_autocomplete_fragment1);

Fehler bin ich immer

Incovertible Art;kann nicht Stimmen " android.Unterstützung.v4.app.Fragment' zu com.google.android.gms.Lage.PlaceAutocompleteFragment '.

XML-LAYOUT IST

  <android.support.v7.widget.CardView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/button_background"
            card_view:cardCornerRadius="4dp"
            card_view:contentPadding="0dp">
        <fragment
            android:id="@+id/place_autocomplete_fragment"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="Enter Place"
            android:background="#fff"
            android:name="com.google.android.gms.location.places.ui.PlaceAutocompleteFragment"
            />
            </android.support.v7.widget.CardView>

Vielen Dank im Voraus

  • Posten Sie Ihre xml-layout.
  • Nair siehe meine Antwort unten.
  • Kannst du den vollständigen code hier oder git-hub und einen link posten. Ich arbeite auf die gleiche here und läuft in zahlreichen Fehler @Amit Nair
InformationsquelleAutor Amit Nair | 2016-05-03
Schreibe einen Kommentar