पर बंद हो रहा है, मैं पहली बार जगह स्वतः पूर्ण टुकड़ा लागू करने की कोशिश कर रहा हूं और इसके साथ एक समस्या का सामना कर रहा हूं। जब भी मैं टाइप करना शुरू करता हूं, पहले अक्षर के बाद यह खोज शुरू करता है और परिणाम दिखाने के बजाए (टुकड़ा) बस गायब हो जाता है .. insted है कि मैं हो रही है स्थिति {statusCode = PLACES_API_ACCESS_NOT_CONFIGURED, संकल्प = अशक्त}एंड्रॉइड प्लेस स्वत: पूर्ण फ्रैगमेंट अपने स्वयं के
Manifest.xml
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="Axxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx4" />
Xml_layout
<TextView
android:text="TextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginTop="14dp"
android:id="@+id/Area"
android:onClick="Onselection"
android:layout_alignParentEnd="true"
android:layout_alignParentStart="true" />
<fragment
android:id="@+id/place_autocomplete_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:name="com.google.android.gms.location.places.ui.PlaceAutocompleteFragment"
android:layout_below="@+id/Area"
android:layout_alignParentStart="true" />
वर्ग Android पर Google API के साथ डेवलप जबकि
public class test extends AppCompatActivity implements PlaceSelectionListener {
private static final String LOG_TAG = "PlaceSelectionListener";
private static final LatLngBounds BOUNDS_MOUNTAIN_VIEW = new LatLngBounds(
new LatLng(-85, -180), new LatLng(85, 180));
private static final int REQUEST_SELECT_PLACE = 1000;
TextView locationtext ;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_testtttt);
locationtext = (TextView) findViewById(R.id.Arear) ;
PlaceAutocompleteFragment autocompleteFragment = (PlaceAutocompleteFragment)
getFragmentManager().findFragmentById(R.id.place_autocomplete_fragment);
autocompleteFragment.setOnPlaceSelectedListener(this);
AutocompleteFilter typeFilter = new AutocompleteFilter.Builder()
.setTypeFilter(AutocompleteFilter.TYPE_FILTER_ADDRESS)
.build();
autocompleteFragment.setFilter(typeFilter);
}
public void Onselection(View v)
{
try {
Intent intent = new PlaceAutocomplete.IntentBuilder
(PlaceAutocomplete.MODE_OVERLAY)
.setBoundsBias(BOUNDS_MOUNTAIN_VIEW)
.build(testtttt.this);
startActivityForResult(intent, REQUEST_SELECT_PLACE);
} catch (GooglePlayServicesRepairableException |
GooglePlayServicesNotAvailableException e) {
e.printStackTrace();
}
}
@Override
public void onPlaceSelected(Place place) {
}
@Override
public void onError(Status status) {
}
fragment disappears/closed on its own
आपका उत्तर पिछले जवाब के समान दिखता है काम कर रिहाई SHA1 अनुप्रयोग के साथ डिबग SHA1 कुंजी बदलें। –