當前位置: 首頁>>代碼示例>>Java>>正文


Java Places.getPlaceDetectionClient方法代碼示例

本文整理匯總了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);
}
 
開發者ID:panzerama,項目名稱:Dispatch,代碼行數:48,代碼來源:MainActivity.java

示例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);
}
 
開發者ID:niqo01,項目名稱:RxTask,代碼行數:4,代碼來源:RxPlaceDetectionClient.java


注:本文中的com.google.android.gms.location.places.Places.getPlaceDetectionClient方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。