當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。