本文整理汇总了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);
}
示例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();
}
}
示例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();
}
}
示例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();
}
}
示例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();
}
}
示例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();
}
}
示例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());
}
}
示例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));
}
}
示例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();
}
}
示例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();
}
}
示例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!");
}
}
示例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!");
}
}