当前位置: 首页>>代码示例>>Java>>正文


Java PlaceBuffer.getAttributions方法代码示例

本文整理汇总了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()));
    }
}
 
开发者ID:Truiton,项目名称:PlaceAPIAutocomplete,代码行数:21,代码来源:MainActivity.java

示例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();

}
 
开发者ID:movers-gcw,项目名称:movemate_android,代码行数:13,代码来源:CreateRouteFragment.java

示例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();
}
 
开发者ID:David-Hackro,项目名称:ExamplesAndroid,代码行数:30,代码来源:MainActivity.java


注:本文中的com.google.android.gms.location.places.PlaceBuffer.getAttributions方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。