本文整理匯總了Java中com.google.android.gms.location.places.Places.getPlaceDetectionClient方法的典型用法代碼示例。如果您正苦於以下問題:Java Places.getPlaceDetectionClient方法的具體用法?Java Places.getPlaceDetectionClient怎麽用?Java Places.getPlaceDetectionClient使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.android.gms.location.places.Places
的用法示例。
在下文中一共展示了Places.getPlaceDetectionClient方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onCreate
import com.google.android.gms.location.places.Places; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
// Start Init
super.onCreate(savedInstanceState);
// LUKE - 12/9/17 - lock orientation to portrait mode
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
drawer.setDrawerListener(toggle);
toggle.syncState();
NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
navigationView.setNavigationItemSelectedListener(this);
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(map);
mapFragment.getMapAsync(this);
getLocationPermission();
// Construct a GeoDataClient.
mGeoDataClient = Places.getGeoDataClient(this, null);
// Construct a PlaceDetectionClient.
mPlaceDetectionClient = Places.getPlaceDetectionClient(this, null);
// Construct a FusedLocationProviderClient.
mFusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(this);
if (savedInstanceState != null) {
mCurrentLocation = savedInstanceState.getParcelable(KEY_LOCATION);
mCameraPosition = savedInstanceState.getParcelable(KEY_CAMERA_POSITION);
}
mUserManager = new UserManager();
determineIntent();
createAddressDialogButton();
context = getApplicationContext();
DEFAULT_ZOOM = 13;
mDefaultLocation = new LatLng(0, 0);
}
示例2: RxPlaceDetectionClient
import com.google.android.gms.location.places.Places; //導入方法依賴的package包/類
public RxPlaceDetectionClient(@NonNull Context context, @Nullable PlacesOptions options) {
this.client = Places.getPlaceDetectionClient(context, options);
}