本文整理汇总了Java中com.google.android.gms.location.places.PlaceBuffer.getAttributions方法的典型用法代码示例。如果您正苦于以下问题:Java PlaceBuffer.getAttributions方法的具体用法?Java PlaceBuffer.getAttributions怎么用?Java PlaceBuffer.getAttributions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.android.gms.location.places.PlaceBuffer
的用法示例。
在下文中一共展示了PlaceBuffer.getAttributions方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onResult
import com.google.android.gms.location.places.PlaceBuffer; //导入方法依赖的package包/类
@Override
public void onResult(PlaceBuffer places) {
if (!places.getStatus().isSuccess()) {
Log.e(LOG_TAG, "Place query did not complete. Error: " +
places.getStatus().toString());
return;
}
// Selecting the first object buffer.
final Place place = places.get(0);
CharSequence attributions = places.getAttributions();
mNameTextView.setText(Html.fromHtml(place.getName() + ""));
mAddressTextView.setText(Html.fromHtml(place.getAddress() + ""));
mIdTextView.setText(Html.fromHtml(place.getId() + ""));
mPhoneTextView.setText(Html.fromHtml(place.getPhoneNumber() + ""));
mWebTextView.setText(place.getWebsiteUri() + "");
if (attributions != null) {
mAttTextView.setText(Html.fromHtml(attributions.toString()));
}
}
示例2: onResult
import com.google.android.gms.location.places.PlaceBuffer; //导入方法依赖的package包/类
@Override
public void onResult(PlaceBuffer places) {
if (!places.getStatus().isSuccess()) {
Log.e(LOG_TAG, "Place query did not complete. Error: " +
places.getStatus().toString());
return;
}
// Selecting the first object buffer.
final Place place = places.get(0);
CharSequence attributions = places.getAttributions();
}
示例3: 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();
}