Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//  use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of

import android.content.Context;

import android.support.annotation.Nullable;

public class Main {
    private static Context sApplicationContext;

    /**
     * A forced setting of an application context for the SDK.
     * That method must be call in services of broadcast events for prepare the SDK for a work.
     *
     * @param appContext Context of application
     */
    static void setApplicationContext(Context appContext) {
        if (appContext != null) {
            sApplicationContext = appContext.getApplicationContext();
        }
    }

    @Nullable
    public static Context getApplicationContext() {
        return sApplicationContext;
    }
}