Example usage for android.content ContentProvider onCreate

List of usage examples for android.content ContentProvider onCreate

Introduction

In this page you can find the example usage for android.content ContentProvider onCreate.

Prototype

public abstract boolean onCreate();

Source Link

Document

Implement this to initialize your content provider on startup.

Usage

From source file:org.moneymanagerex.android.testhelpers.UnitTestHelper.java

/**
 * Initialize the content provider explicitly as it is not executed automatically.
 * Also, call teardownDatabase after each test, in @After.
 * @return initialized Content Provider, if needed.
 *//*from ww w . j a v a 2  s  .  c  om*/
public static ContentProvider setupContentProvider() {
    ContentProvider contentProvider = new MmxContentProvider();
    //        shadowOf(contentProvider).getContext();
    contentProvider.onCreate();
    ShadowContentResolver.registerProvider(MmxContentProvider.getAuthority(), contentProvider);

    return contentProvider;
}