本文整理汇总了Java中com.google.android.gms.location.places.PlaceBuffer.release方法的典型用法代码示例。如果您正苦于以下问题:Java PlaceBuffer.release方法的具体用法?Java PlaceBuffer.release怎么用?Java PlaceBuffer.release使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.android.gms.location.places.PlaceBuffer
的用法示例。
在下文中一共展示了PlaceBuffer.release方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onResult
import com.google.android.gms.location.places.PlaceBuffer; //导入方法依赖的package包/类
@Override
public void onResult(PlaceBuffer places) {
if (!places.getStatus().isSuccess()) {
places.release();
return;
}
try {
final Place place = places.get(0);
if (Preferences.getInstance(SearchActivity.this).isLogged()) {
searchPresenter.getNearStations(place.getLatLng());
places.release();
} else {
Intent returnIntent = new Intent();
returnIntent.putExtra(MapFragment.LATITUDE_SEARCH, place.getLatLng().latitude);
returnIntent.putExtra(MapFragment.LONGITUDE_SEARCH, place.getLatLng().longitude);
places.release();
setResult(Activity.RESULT_OK, returnIntent);
finish();
}
} catch (Throwable throwable) {
resultsRecyclerView.setVisibility(View.GONE);
emptyTextView.setVisibility(View.VISIBLE);
emptyTextView.setText(getString(R.string.error_generic));
}
}
示例2: onResult
import com.google.android.gms.location.places.PlaceBuffer; //导入方法依赖的package包/类
@Override
public void onResult (PlaceBuffer places) {
if (!places.getStatus ().isSuccess ()) {
// Request did not statusComplete successfully
Log.e("", "Place query did not statusComplete. Error: " + places.getStatus().toString());
places.release ();
return;
}
// Get the Place object from the buffer.
final Place place = places.get (0);
Log.e("Place", place.getAddress() + "");
mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(place.getLatLng(), 16.0f));
Log.i("", "LatLog " + place.getLatLng());
Log.i("", "Place details received: " + place.getName());
places.release();
}
示例3: onResult
import com.google.android.gms.location.places.PlaceBuffer; //导入方法依赖的package包/类
@Override public void onResult(@NonNull PlaceBuffer places) {
if (!places.getStatus().isSuccess()) {
places.release();
return;
}
final Place place = places.get(0);
if (mAutoCompleteLocationListener != null) {
mAutoCompleteLocationListener.onItemSelected(place);
}
places.release();
}
示例4: onResult
import com.google.android.gms.location.places.PlaceBuffer; //导入方法依赖的package包/类
@Override
public void onResult(PlaceBuffer places) {
if (!places.getStatus().isSuccess()) {
if (callback != null) callback.onSuggestFail(places.getStatus());
places.release();
return;
}
final Place place = places.get(0);
if (callback != null) callback.onSuggestResult(place, myact);
places.release();
}
示例5: onResult
import com.google.android.gms.location.places.PlaceBuffer; //导入方法依赖的package包/类
@Override
public void onResult(PlaceBuffer places) {
if (!places.getStatus().isSuccess()) {
places.release();
return;
}
// Get the Place object from the buffer.
final Place place = places.get(0);
hideKeyboard();
mLatitude=String.valueOf(place.getLatLng().latitude);
mLongitude=String.valueOf(place.getLatLng().longitude);
LatLng newLatLngTemp = new LatLng(place.getLatLng().latitude, place.getLatLng().longitude);
// LatLng centerLatLng=new LatLng(mMap.getCameraPosition().target.latitude,mMap.getCameraPosition().target.longitude);
mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(newLatLngTemp, 15f));
}
示例6: onResult
import com.google.android.gms.location.places.PlaceBuffer; //导入方法依赖的package包/类
@Override
public void onResult(PlaceBuffer places) {
if (!places.getStatus().isSuccess()) {
// Request did not complete successfully
Log.e(TAG, "Place query did not complete. Error: " + places.getStatus().toString());
places.release();
return;
}
// Get the Place object from the buffer.
final Place place = places.get(0);
// Format details of the place for display and show it in a TextView.
mPlaceDetailsText.setText(formatPlaceDetails(getResources(), place.getName(),
place.getId(), place.getAddress(), place.getPhoneNumber(),
place.getWebsiteUri()));
// Display the third party attributions if set.
final CharSequence thirdPartyAttribution = places.getAttributions();
if (thirdPartyAttribution == null) {
mPlaceDetailsAttribution.setVisibility(View.GONE);
} else {
mPlaceDetailsAttribution.setVisibility(View.VISIBLE);
mPlaceDetailsAttribution.setText(Html.fromHtml(thirdPartyAttribution.toString()));
}
Log.i(TAG, "Place details received: " + place.getName());
places.release();
}