-
- All Implemented Interfaces:
public interface AppContextService
-
-
Method Summary
Modifier and Type Method Description abstract voidsetApplication(@NonNull() Application application)Set the Android Application, which enables the SDK get the app Context, register a Application.ActivityLifecycleCallbacks to monitor the lifecycle of the app and get the android.app.Activity on top of the screen.abstract ApplicationgetApplication()Get the global Application object of the current process. abstract ActivitygetCurrentActivity()Returns the current Activityabstract ContextgetApplicationContext()Returns the application Contextabstract ObjectgetAppState()Get the current application state. -
-
Method Detail
-
setApplication
abstract void setApplication(@NonNull() Application application)
Set the Android Application, which enables the SDK get the app
Context, register a Application.ActivityLifecycleCallbacks to monitor the lifecycle of the app and get the android.app.Activity on top of the screen.NOTE: This method should be called right after the app starts, so it gives the SDK all the contexts it needed.
- Parameters:
application- the Android Application instance.
-
getApplication
@Nullable() abstract Application getApplication()
Get the global Application object of the current process.
NOTE: setApplication must be called before calling this method.
-
getCurrentActivity
@Nullable() abstract Activity getCurrentActivity()
Returns the current
Activity
-
getApplicationContext
@Nullable() abstract Context getApplicationContext()
Returns the application
Context
-
getAppState
@NonNull() abstract Object getAppState()
Get the current application state.
-
-
-
-