0

this viewmodel method is calling in oncreate:

override fun deleteVideoOneByOne() {
            deleteFileCount = getSelectedFilePath().size
            for (i in 0 until deleteFileCount) {
                listOfDeleteItemPosition = finalListOfData.indexOf(getSelectedFilePath()[i])
                getSelectedFilePath()[i].path?.let { getR24kDashCamUseCase.deleteSingleVideo(it) }
            }
        }

This is method of usecase

override fun deleteSingleVideo(path: 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)
        )
    }

i have to call method one by one delete video file one by one want to get response one at a time . i have 5 video and user cans elect 1 to max 5 video delete so suppose user select 3 video then 2 time api call one by one and i should get response one at a time suppose if user select 2 video then delete api should call 2 time one by one and one at a time we should get response please help how we can write this in rx kotlin so that i can delete one at a time video .

MARSH
  • 117
  • 1
  • 7
  • 22

0 Answers0