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


Java PlacePicker.IntentBuilder方法代码示例

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


在下文中一共展示了PlacePicker.IntentBuilder方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onWaypointTitleClick

import com.google.android.gms.location.places.ui.PlacePicker; //导入方法依赖的package包/类
@OnClick(R.id.reminder_item_waypoint_title_text_view)
public void onWaypointTitleClick() {
    PlacePicker.IntentBuilder builder = new PlacePicker.IntentBuilder();
    if (mRemindItem.getWaypoint() != null) {
        LocationPoint locationPoint = mRemindItem.getWaypoint().getLocation();
        LatLng latLng = new LatLng(locationPoint.getLatitude(), locationPoint.getLongitude());
        LatLngBounds latLngBounds = new LatLngBounds(latLng, latLng);
        builder.setLatLngBounds(latLngBounds);
    }

    Intent intent = null;
    try {
        intent = builder.build(getActivity());
    } catch (GooglePlayServicesRepairableException | GooglePlayServicesNotAvailableException e) {
        e.printStackTrace();
    }
    mProgressDialog = ProgressDialog.show(mContext,
            getString(R.string.reminder_place_picker_progress_dialog_title),
            getString(R.string.reminder_place_picker_progress_dialog_message), true, false);
    startActivityForResult(intent, PLACE_PICKER_REQUEST);
}
 
开发者ID:trigor74,项目名称:travelers-diary,代码行数:22,代码来源:ReminderItemFragment.java

示例2: onPickEventPlaceClick

import com.google.android.gms.location.places.ui.PlacePicker; //导入方法依赖的package包/类
/**
 * Pick place
 * https://medium.com/@hitherejoe/exploring-play-services-place-picker-autocomplete-150809f739fe
 */
@Override
public void onPickEventPlaceClick() {
    PlacePicker.IntentBuilder intentBuilder = new PlacePicker.IntentBuilder();
    if(editEventDataModel.getEvent().hasLocation()) {
        double longitude = editEventDataModel.getEvent().getLongitude();
        double latitude = editEventDataModel.getEvent().getLatitude();
        double offset = 0.01;
        LatLng southwest = new LatLng(latitude - offset, longitude - offset);
        LatLng northeast = new LatLng(latitude + offset, longitude + offset);
        intentBuilder.setLatLngBounds(new LatLngBounds(southwest, northeast));
    }
    try {
        startActivityForResult(intentBuilder.build(this), PLACE_PICKER_REQUEST_CODE);
    } catch (GooglePlayServicesRepairableException | GooglePlayServicesNotAvailableException e) {
        e.printStackTrace();
        Toast.makeText(this, getString(R.string.unknown_error), Toast.LENGTH_LONG).show();
    }
}
 
开发者ID:LibertACAO,项目名称:libertacao-android,代码行数:23,代码来源:EditEventActivity.java

示例3: pickLocationClicked

import com.google.android.gms.location.places.ui.PlacePicker; //导入方法依赖的package包/类
public void pickLocationClicked(View view) {
    try {
        PlacePicker.IntentBuilder builder = new PlacePicker.IntentBuilder();
        startActivityForResult(builder.build(this), PLACE_PICKER_REQUEST);
    } catch (Exception e) {
        Toast.makeText(getApplicationContext(),
                "Play services not available.",
                Toast.LENGTH_SHORT).show();
    }
}
 
开发者ID:bsautermeister,项目名称:GeoFencer,代码行数:11,代码来源:SettingsActivity.java

示例4: locationPlacesIntent

import com.google.android.gms.location.places.ui.PlacePicker; //导入方法依赖的package包/类
private void locationPlacesIntent() {

        try {
            PlacePicker.IntentBuilder builder = new PlacePicker.IntentBuilder();
            startActivityForResult(builder.build(getActivity()), PLACE_PICKER_REQUEST);
        } catch (GooglePlayServicesRepairableException | GooglePlayServicesNotAvailableException e) {
            e.printStackTrace();
        }
    }
 
开发者ID:sega4revenge,项目名称:Sega,代码行数:10,代码来源:ProfileDetailFragment.java

示例5: locationPlacesIntent

import com.google.android.gms.location.places.ui.PlacePicker; //导入方法依赖的package包/类
private void locationPlacesIntent() {

        try {
            PlacePicker.IntentBuilder builder = new PlacePicker.IntentBuilder();
            startActivityForResult(builder.build(this), PLACE_PICKER_REQUEST);
        } catch (GooglePlayServicesRepairableException | GooglePlayServicesNotAvailableException e) {
            e.printStackTrace();
        }
    }
 
开发者ID:sega4revenge,项目名称:Sega,代码行数:10,代码来源:AddProductActivity.java

示例6: locationPlacesIntent

import com.google.android.gms.location.places.ui.PlacePicker; //导入方法依赖的package包/类
/**
 * Obter local do usuario
 */
private void locationPlacesIntent() {

    try {
        PlacePicker.IntentBuilder builder = new PlacePicker.IntentBuilder();
        startActivityForResult(builder.build(this), PLACE_PICKER_REQUEST);
    } catch (GooglePlayServicesRepairableException | GooglePlayServicesNotAvailableException e) {
        e.printStackTrace();
    }
}
 
开发者ID:sega4revenge,项目名称:Sega,代码行数:13,代码来源:ChatActivity.java

示例7: showLocationPicker

import com.google.android.gms.location.places.ui.PlacePicker; //导入方法依赖的package包/类
private void showLocationPicker(int resultCode) {
  PlacePicker.IntentBuilder builder = new PlacePicker.IntentBuilder();
  LatLng burmaNorth = new LatLng(16.193669, 95.229859);
  LatLng burmaSouth = new LatLng(28.279449, 97.576320);
  LatLngBounds bound = new LatLngBounds(burmaNorth, burmaSouth);

  builder.setLatLngBounds(bound);

  try {
    activity.startActivityForResult(builder.build(activity), resultCode);
  } catch (Exception e) {
    Log.e(TAG, e.getMessage());
  }
}
 
开发者ID:goutfeb,项目名称:ElephantAsia,代码行数:15,代码来源:LocationDialog.java

示例8: loadAddNewPrivyActivity

import com.google.android.gms.location.places.ui.PlacePicker; //导入方法依赖的package包/类
private void loadAddNewPrivyActivity() {
    if (checkIfLoggedIn()) {
        PlacePicker.IntentBuilder builder = new PlacePicker.IntentBuilder();
        try {
            startActivityForResult(builder.build(this), PLACE_PICKER_REQUEST);
        } catch (Exception e) {
            Log.d(DEBUG, e.toString());
        }
    } else {
        startGoogleSignInActivity(RC_SIGN_IN_NEW_PRIVY_REQUEST);
        snackMsg(getString(R.string.request_location_permission));
    }
}
 
开发者ID:pulkit4tech,项目名称:Privy,代码行数:14,代码来源:MainActivity.java

示例9: addLocation

import com.google.android.gms.location.places.ui.PlacePicker; //导入方法依赖的package包/类
protected void addLocation() {
    if (QiscusPermissionsUtil.hasPermissions(getActivity(), LOCATION_PERMISSION)) {
        PlacePicker.IntentBuilder builder = new PlacePicker.IntentBuilder();
        try {
            startActivityForResult(builder.build(getActivity()), PICK_LOCATION_REQUEST);
        } catch (GooglePlayServicesRepairableException | GooglePlayServicesNotAvailableException e) {
            e.printStackTrace();
        }
        hideAttachmentPanel();
    } else {
        requestAddLocationPermission();
    }
}
 
开发者ID:qiscus,项目名称:qiscus-sdk-android,代码行数:14,代码来源:QiscusBaseChatFragment.java

示例10: pickPushLocationButtonClicked

import com.google.android.gms.location.places.ui.PlacePicker; //导入方法依赖的package包/类
@OnClick(R.id.pickPushLocationButton)
public void pickPushLocationButtonClicked() {
    PlacePicker.IntentBuilder intentBuilder = new PlacePicker.IntentBuilder();
    try {
        startActivityForResult(intentBuilder.build(this), PLACE_PICKER_REQUEST_CODE);
    } catch (GooglePlayServicesRepairableException | GooglePlayServicesNotAvailableException e) {
        e.printStackTrace();
        Toast.makeText(this, getString(R.string.unknown_error), Toast.LENGTH_LONG).show();
    }
}
 
开发者ID:LibertACAO,项目名称:libertacao-android,代码行数:11,代码来源:SendPushActivity.java

示例11: pickLocation

import com.google.android.gms.location.places.ui.PlacePicker; //导入方法依赖的package包/类
@OnClick(R.id.button_add_location)
public void pickLocation() {
    PlacePicker.IntentBuilder builder = new PlacePicker.IntentBuilder();
    try {
        startActivityForResult(builder.build(getActivity()), REQUEST_PICK_LOCATION);
    } catch (GooglePlayServicesRepairableException | GooglePlayServicesNotAvailableException e) {
        e.printStackTrace();
        showError("Failed to access location!");
    }
}
 
开发者ID:zetbaitsu,项目名称:Sigap,代码行数:11,代码来源:ChatFragment.java

示例12: pickLocation

import com.google.android.gms.location.places.ui.PlacePicker; //导入方法依赖的package包/类
@OnClick(R.id.button_pick_location)
public void pickLocation() {
    PlacePicker.IntentBuilder builder = new PlacePicker.IntentBuilder();
    try {
        startActivityForResult(builder.build(this), REQUEST_PICK_LOCATION);
    } catch (GooglePlayServicesRepairableException | GooglePlayServicesNotAvailableException e) {
        e.printStackTrace();
        showError("Failed to access locationText!");
    }
}
 
开发者ID:zetbaitsu,项目名称:Sigap,代码行数:11,代码来源:RequestEscortActivity.java


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