Multidex by extending MultiDexApplication

suggest change

This is very similar to using an Application subclass and overriding the attachBaseContext() method.

However, by extending MultiDexApplication you don't need to override attachBaseContext(). The superclass already does that.

Extend MultiDexApplication instead of Application:

package com.example;

import android.support.multidex.MultiDexApplication;

/**
 * Extended MultiDexApplication 
 */
public class MyApplication extends MultiDexApplication {

     // No need to override attachBaseContext()

     //..........
}

Add this class to your AndroidManifest.xml exactly as if you were extending Application:

<application
    android:name="com.example.MyApplication"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name">
</application>

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents