android - Custom Downloader using Picasso -
I need some headers (username, password) with the request to which to download an image from a URL . That's why I'm using that given code. But this function returns a call error
java.lang.NoClassDefFoundError:. Com.squareup.picasso.OkHttpDownloader com.squareup.okhttp.OkHttpClient & LT; Init & gt; (OkHttpDownloader.java:72)
I have been raised have been using Picasso 2.3.3 and Okteepi-URL connection-2.0.0-RC 2 libraries to this issue later, But changing to 2.3.2 does not work.
Do you have OKHTP in your project? If not, the problem is that you are using OkHttpDownloader are you like in your project OkHttp library or just UrlConnectionDownloader down.
This result was finished with me.
public static Picasso GetImageLoader (Context ctx) {Pikasokbilder builder = new Pikasokbilder (Sitiaks); Connection.setRequestProperty ("X-header", "VAL") ;; Return connection builder.downloader (New UrlConnectionDownloader (ctx) {@Override protect HttpURLConnection openConnection (Uri uri) IOException {HttpURLConnection connection = throws super.openConnection (URI);}}); Return Manufacturer Build (); }
Comments
Post a Comment