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


Java PlaceBuffer.get方法代码示例

本文整理汇总了Java中com.google.android.gms.location.places.PlaceBuffer.get方法的典型用法代码示例。如果您正苦于以下问题:Java PlaceBuffer.get方法的具体用法?Java PlaceBuffer.get怎么用?Java PlaceBuffer.get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.android.gms.location.places.PlaceBuffer的用法示例。


在下文中一共展示了PlaceBuffer.get方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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));
    }
}
 
开发者ID:Mun0n,项目名称:MADBike,代码行数:26,代码来源:SearchActivity.java

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


}
 
开发者ID:blessingoraz,项目名称:Akwukwo,代码行数:23,代码来源:SearchLocationActivity.java

示例3: 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

示例4: 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();
}
 
开发者ID:jotaramirez90,项目名称:AutocompleteLocation,代码行数:12,代码来源:AutoCompleteLocation.java

示例5: 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();
     }
 
开发者ID:agusibrahim,项目名称:go-jay,代码行数:12,代码来源:PlaceAutoCompleteHelper.java

示例6: onResult

import com.google.android.gms.location.places.PlaceBuffer; //导入方法依赖的package包/类
@Override
public void onResult(PlaceBuffer places) {
    if (!places.getStatus().isSuccess()) {
        return;
    }
    place = places.get(0);

}
 
开发者ID:alewin,项目名称:moneytracking,代码行数:9,代码来源:NewItemActivity.java

示例7: onResult

import com.google.android.gms.location.places.PlaceBuffer; //导入方法依赖的package包/类
@Override
public void onResult(PlaceBuffer places) {
    if (!places.getStatus().isSuccess()) {
        return;
    }
    // Selecting the first object buffer.
    place = places.get(0);
    addLocation.setText(place.getAddress().toString());
    return;


}
 
开发者ID:alewin,项目名称:moneytracking,代码行数:13,代码来源:EditActivity.java

示例8: 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

示例9: 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));
}
 
开发者ID:SkyTreasure,项目名称:Airbnb-Android-Google-Map-View,代码行数:16,代码来源:SearchPlaceOnMapActivity.java

示例10: 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.get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。