Skip to content Skip to sidebar Skip to footer

Java Start Next Loop Iteration After Inner Class Has Finished

So I got stuck on a pretty basic Java thing. Namely I have an iteration that needs to go to a next loop after the inner class has finished. But since the inner class takes a lot of

Solution 1:

Have you considered recursion?

voidmyMethod(int index) {
    String[] cmd = { "-i",  imageToBeFiltered.toString(), "-filter_complex", filters[loopCounter], imageWithFilter.toString()};

    ffmpeg.execute(cmd, newExecuteBinaryResponseHandler() {

        @OverridepublicvoidonSuccess(String message) {
            super.onSuccess(message);

            if (index < 10) myMethod(index++);

        }
        @OverridepublicvoidonFailure(String message) {
            super.onFailure(message);

            if (index < 10) myMethod(index++);
        }
    });
}

EDIT:

I'm guessing that loopCounter is supposed to be the index, in which case you'll want to change that if you use this code.

Post a Comment for "Java Start Next Loop Iteration After Inner Class Has Finished"