corouteam / GlideToVectorYou

Load SVGs in Android with Glide
Apache License 2.0
209 stars 20 forks source link

I can not download jpeg file #2

Closed TikTak123 closed 5 years ago

TikTak123 commented 5 years ago

When downloading a jpeg file, onFailed is triggered in the listeners

Here is my code

val url = "https://images.unsplash.com/photo-1510940753358-0c6d35aa3981?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=ee87f47a0eed59e87bc2cb94ac4bcc78&auto=format&fit=crop&w=1350&q=80"

GlideToVectorYou
                .init()
                .with(this)
                .withListener(object : GlideToVectorYouListener {
                    override fun onLoadFailed() {
                        Toast.makeText(this@MainActivity, "onLoadFailed", Toast.LENGTH_LONG).show()
                    }

                    override fun onResourceReady() {
                        Toast.makeText(this@MainActivity, "onResourceReady", Toast.LENGTH_LONG).show()
                    }
                })
                .load(Uri.parse(url), imageView)
chadallen87 commented 5 years ago

i was seeing a similar issue on emulator only but worked fine on actual device, the emulator was getting a timeout exception

TikTak123 commented 5 years ago

Hello! @chadallen87 I tested on real device and the emulator does not work.

paolorotolo commented 5 years ago

Hey @chadallen87! Check the network connection on your emulator. Glide also has a default timeout time for a download to complete, you might try increasing it if networking is very slow.

I'm closing this for now, please feel free to reopen in case you have other related unintended behaviour.