다음 2 개의 asynctasks를 rxjava로 변환하려고 시도하고 있지만 어떻게해야하는지 잘 모릅니다. 어떤 아이디어? :asynctask를 Rxjava로 변환하려면 어떻게해야합니까?
new AsyncTask<Void, Void, Void>() {
@Override
protected Void doInBackground(Void... params) {
/* Shutdown video players */
Set<Map.Entry<String, PlayerBundle>> entries = videoPlayerPool.entrySet();
for (Map.Entry<String, PlayerBundle> entry : entries) {
PlayerBundle bundle = entry.getValue();
bundle.player.release();
}
/* Shutdown audio players */
entries = audioPlayerPool.entrySet();
for (Map.Entry<String, PlayerBundle> entry : entries) {
PlayerBundle bundle = entry.getValue();
bundle.player.release();
}
videoStreamer.stopStream();
videoStreamer.release();
audioStreamer.stopStream();
audioStreamer.release();
return null;
}
@Override
protected void onPostExecute(Void aVoid) {
cb.event(new Spin.Event<Void>());
}
}.execute();
과 :
new AsyncTask<Void, Void, Void>() {
@Override
protected Void doInBackground(Void... params) {
Set<Map.Entry<String, Participant>> entries = pool.entrySet();
for (Map.Entry<String, Participant> entry : entries) {
Participant participant = entry.getValue();
participant.release();
}
return null;
}
@Override
protected void onPostExecute(Void aVoid) {
cb.event(new Spin.Event<Void>());
}
}.execute();
나는 이미 내 Gradle을에서 rxjava을 포함하지만,이
이 https를 시도 변환하는 방법에 대한 이동하는 방법을 잘하지 않은 : // piercezaifman합니다. co.kr/converting-an-asynctask-to-rxjava /를 읽고 문제가 발생할 때 진짜 질문을하십시오. 키워드 "TRY" –