Im Rick James
Im Rick James

Reputation: 255

Volley + Multidex Application Name in Manifest

Folks my project used Volley lib to show thumb images in a recyclelistview, however my app has grown big and I had to use Multidex flag to true, and I had to remove

<!--android:name=".controller.AppController"-->

and use:

manifest.xml

<application
        android:name="android.support.multidex.MultiDexApplication"

myfragmentclass.java
...
    ImageLoader imageLoader = AppController.getInstance().getImageLoader();
...

AppController.java

public class AppController extends Application {
...
}

so when my framgment instantiates the volley object it gets an NPE since there is no constructor for the class.

Is there a way I can make it work or should I use another lib for loading images from network dinamically when user scrolls the list?

thanks,

Upvotes: 1

Views: 651

Answers (1)

hoangdv
hoangdv

Reputation: 16137

You can! Your .controller.AppController initialize all instance for volley and each other. Nomarly AppController extend Application, in your case you need make AppController extend MultiDexApplication, !remember alway call super fuction() if you overider a function, then make your manifest.xml normal like first case android:name=".controller.AppController"

Upvotes: 3

Related Questions