Search code examples
androidandroid-glide

Is downloadOnly synchronous or asynchronous in Android Glide?


Consider the following line of code:

Glide.with(getContext()).downloadOnly().load(some_uri).submit();

Question 1) Is the above synchronous or asynchronous?

Question 2) If the above is synchronous, then how do I make it asynchronous?

Question 3) If the above is asynchronous, then how do I make it synchronous?

The question refers specifically to the Glide version 4 API.


Solution

  • Answering my own question.

    Glide.with(getContext()).downloadOnly().load(some_uri).submit();
    

    is asynchronous.

    Glide.with(getContext()).downloadOnly().load(some_uri).submit().get();
    

    is synchronous.