Skip to content

Most visited

Recently visited

navigation

MultiDex

public final class MultiDex
extends Object

java.lang.Object
   ↳ android.support.multidex.MultiDex


MultiDex patches the application context class loader in order to load classes from more than one dex file. The primary classes.dex must contain the classes necessary for calling this class methods. Secondary dex files named classes2.dex, classes3.dex... found in the application apk will be added to the classloader after first call to install(Context).

This library provides compatibility for platforms with API level 4 through 20. This library does nothing on newer versions of the platform which provide built-in support for secondary dex files.

Summary

Public methods

static void install(Context context)

Patches the application context class loader by appending extra dex files loaded from the application apk.

Inherited methods

From class java.lang.Object

Public methods

install

void install (Context context)

Patches the application context class loader by appending extra dex files loaded from the application apk. This method should be called in the attachBaseContext of your Application, see MultiDexApplication for more explanation and an example.

Parameters
context Context: application context.

Throws
RuntimeException if an error occurred preventing the classloader extension.
This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a one-minute survey?
Help us improve Android tools and documentation.