Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/222.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 按钮自动取消乘坐_Java_Android_Firebase_Driver_Uber Api - Fatal编程技术网

Java 按钮自动取消乘坐

Java 按钮自动取消乘坐,java,android,firebase,driver,uber-api,Java,Android,Firebase,Driver,Uber Api,我有一个按钮,他们叫我 M请求>>wen我按下了按钮,他们叫司机,但如果没有司机,我想设置一个计时器自动取消骑乘请求,只需再次自动按下按钮 mRequest.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (requestBol){

我有一个按钮,他们叫我

M请求>>wen我按下了按钮,他们叫司机,但如果没有司机,我想设置一个计时器自动取消骑乘请求,只需再次自动按下按钮

        mRequest.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (requestBol){
                    endRide();


                }else {
                    int selectId = mRadioGroup.getCheckedRadioButtonId();

                    final RadioButton radioButton = (RadioButton) findViewById(selectId);

                    if (radioButton.getText() == null) {
                        return;
                    }

                    requestService = radioButton.getText().toString();
                    requestBol = true;

                    String userId = FirebaseAuth.getInstance().getCurrentUser().getUid();

                    DatabaseReference ref = FirebaseDatabase.getInstance().getReference("customerRequest");
                    GeoFire geoFire = new GeoFire(ref);
                    geoFire.setLocation(userId, new GeoLocation(mLastLocation.getLatitude(), mLastLocation.getLongitude()));

                    pickupLocation = new LatLng(mLastLocation.getLatitude(), mLastLocation.getLongitude());
                    pickupMarker = mMap.addMarker(new MarkerOptions().position(pickupLocation).title("Aguarde aqui!").icon(BitmapDescriptorFactory.fromResource(R.mipmap.ic_pickup)));

                    Toast.makeText(getApplicationContext(), "Aguarde que estamos localizando o moto táxi mais próximo!!", Toast.LENGTH_LONG).show();

                    mRequest.setText("Localizando seu moto táxi....");

                    getClosestDriver();
                }

            }
        });