How to call one API with different paramet in Rx Kotlin in Android

24 Views Asked by At

This is function

fun deleteSingleVideoOneByOne(path: ArrayList<String>)

This is implementation

override fun deleteSingleVideoOneByOne(path: ArrayList<String>) {
        val apiService = RetrofitInstance.getApiServiceXMLForR2(
                Constants.BASE_URL_NEW_CAMERA_R2_4K_PRO
        )
        trackDisposable(
                apiService.r2NtKCommandExecute("6006",path)
                        .subscribeOn(schedulerProvider.io())
                        .observeOn(schedulerProvider.ui())
                        .subscribe(::handleDeleteSingleFile, ::handlerError)
        )
    }



private fun handleDeleteSingleFile(response: FunctionModel?) {
        response?.let { callback?.onSuccessDeleteSingleVideo(it) }
    }

above is my code i want call API for all path: ArrayList and once it done i should get success message if any one fail i should get fail response i don't know how i can call once by one and get response at end so that i can subscribe it can any one please help me how we can use zip or flat map to execute api multiple time with different parameter at end i should get response . please help me in this thanks

0

There are 0 best solutions below