小编nev*_*vzo的帖子

使用Google Places API安装Android PlaceFilter

我正在尝试使用Google Places API,我想将搜索过滤为仅限于健身房类型.

我使用的是https://developers.google.com/places/上提供的代码

public void onPickButtonClick(View v) {
// Construct an intent for the place picker
try {
    PlacePicker.IntentBuilder intentBuilder =
        new PlacePicker.IntentBuilder();
    Intent intent = intentBuilder.build(this);
    // Start the intent by requesting a result,
    // identified by a request code.
    startActivityForResult(intent, REQUEST_PLACE_PICKER);

} catch (GooglePlayServicesRepairableException e) {
    // ...
} catch (GooglePlayServicesNotAvailableException e) {
    // ...
}
}

@Override
protected void onActivityResult(int requestCode,
    int resultCode, Intent data) {

if (requestCode == REQUEST_PLACE_PICKER
    && resultCode == Activity.RESULT_OK) …
Run Code Online (Sandbox Code Playgroud)

android google-places-api google-maps-android-api-2

9
推荐指数
1
解决办法
1985
查看次数