library/src/main/java/com/liulishuo/filedownloader/FileDownloader.java
public static DownloadMgrInitialParams.InitCustomMaker setupOnApplicationOnCreate(
            Application application) {
        final Context context = application.getApplicationContext();
        FileDownloadHelper.holdContext(context);

        DownloadMgrInitialParams.InitCustomMaker customMaker =
                new DownloadMgrInitialParams.InitCustomMaker();
        CustomComponentHolder.getImpl().setInitCustomMaker(customMaker);

        return customMaker;
    }
public static DownloadMgrInitialParams.InitCustomMaker setupOnApplicationOnCreate(
            Application application) {
        final Context context = application.getApplicationContext();
        FileDownloadHelper.holdContext(context);

        DownloadMgrInitialParams.InitCustomMaker customMaker =
                new DownloadMgrInitialParams.InitCustomMaker();
        CustomComponentHolder.getImpl().setInitCustomMaker(customMaker);

        return customMaker;
    }
public static DownloadMgrInitialParams . InitCustomMaker setupOnApplicationOnCreate ( Application application ) { final Context context = application . getApplicationContext ( ) ; FileDownloadHelper . holdContext ( context ) ; DownloadMgrInitialParams . InitCustomMaker customMaker = new DownloadMgrInitialParams . InitCustomMaker ( ) ; CustomComponentHolder . getImpl ( ) . setInitCustomMaker ( customMaker ) ; return customMaker ; }
Using this method to setup the FileDownloader only you want to register your own customize
components for Filedownloader, otherwise just using {@link #setup(Context)} instead.
<p/>
Please invoke this method on the {@link Application#onCreate()} because of the customize
components must be assigned before FileDownloader is running.
<p/>
Such as:
<p/>
class MyApplication extends Application {
...
public void onCreate() {
...
FileDownloader.setupOnApplicationOnCreate(this)
.idGenerator(new MyIdGenerator())
.database(new MyDatabase())
...
.commit();
...
}
...
}
@param application the application.
@return the customize components maker.
Using this method to setup the FileDownloader only you want to register your own customize components for Filedownloader otherwise just using {