我在我的应用程序中使用 uber api,我想指定 uber 的类型,例如。优步X。这是为了减少用户在旅行中花费的金额。我的应用程序的当前状态允许用户在我的 product_id 中指定的国家/地区的 uberX 和 Uber 选择之间进行选择。如何禁用 UberSelect 选项?下面是我的小部件的代码:
RideRequestButton rideRequestButton = new RideRequestButton(context);
layout.addView(rideRequestButton);
Activity activity = this; // If you're in a fragment you must get the containing Activity!
int requestCode = 1234;
rideRequestButton.setRequestBehavior(new RideRequestActivityBehavior(activity, requestCode));
// Optional, default behavior is to use current location for pickup
RideParameters rideParams = new RideParameters.Builder()
.setProductId("a1111c8c-c720-46c3-8534-2fcdd730040d")
.setPickupLocation(37.775304, -122.417522, "Uber HQ", "1455 Market Street, San Francisco")
.setDropoffLocation(37.795079, -122.4397805, "Embarcadero", "One Embarcadero Center, San Francisco")
.build();
rideRequestButton.setRideParameters(rideParams);
RideRequestView rideRequestView = new RideRequestView(context);
//Optionally set Session, will use default session from UberSDK otherwise
//rideRequestView.setSession(session);
rideRequestView.setRideParameters(rideParameters)
rideRequestView.setRideRequestViewCallback(new RideRequestViewErrorCallback() {
@Override
public void onErrorReceived(RideRequestViewError error) {
switch (error) {
// Handle errors
}
}
});
layout.addView(rideRequestView);
rideRequestView.load();