error: incompatible types: DownloadProgressCallback cannot be converted to Function3<? super Float,? super Long,? super String,Unit>
from
Disposable disposable = Observable.fromCallable(() -> YoutubeDL.getInstance().execute(request, processId, callback))
and my "callback" is something like this
private final DownloadProgressCallback callback = new DownloadProgressCallback() {
@Override
public void onProgressUpdate(float progress, long etaInSeconds, String line) {
newprogress = progress;
final int max = 100;
createNotificationChannel();
downloadNoti(max);
Runnable download = () -> {
for(newprogress = 0; newprogress <= max; newprogress++) {
builder.setProgress(max,(int)newprogress,false);
notificationManager.notify(2,builder.build());
}
};
Thread thread = new Thread(download);
thread.start();
}
was not having issues all this time and everything would build and run well only,until recently would this error pop up. I did not touch my could for about 1 week and it was working fine before.
I followed android studio suggestion to help fix my code and this is the suggestion:
Disposable disposable = Observable.fromCallable(() -> YoutubeDL.getInstance().execute(request, processId, (Function3<? super Float, ? super Long, ? super String, Unit>) callback))
My app will run now but I don't know what caused this issue and I'm sure there is a better way of fixing this.
*Edit: Nevermind, app won't download anymore after implementing this fix XD with
java.lang.ClassCastException: cannot be cast to kotlin.jvm.functions.Function3
error is
error: incompatible types: DownloadProgressCallback cannot be converted to Function3<? super Float,? super Long,? super String,Unit>
from
Disposable disposable = Observable.fromCallable(() -> YoutubeDL.getInstance().execute(request, processId, callback))
and my "callback" is something like this
was not having issues all this time and everything would build and run well only,until recently would this error pop up. I did not touch my could for about 1 week and it was working fine before.
I followed android studio suggestion to help fix my code and this is the suggestion:
Disposable disposable = Observable.fromCallable(() -> YoutubeDL.getInstance().execute(request, processId, (Function3<? super Float, ? super Long, ? super String, Unit>) callback))
My app will run now but I don't know what caused this issue and I'm sure there is a better way of fixing this.
*Edit: Nevermind, app won't download anymore after implementing this fix XD with
java.lang.ClassCastException: cannot be cast to kotlin.jvm.functions.Function3
*Edit2: could be caused by commit https://github.com/yausername/youtubedl-android/commit/97bee6c0e824b31a2a438800a48012b24de5f24e as everything was working before that. I'm not sure how will that mess with my project though..