public class AndroidFragmentApplication extends androidx.fragment.app.Fragment implements AndroidApplicationBase
AndroidApplicationBase that is based on the Fragment class. This class is similar in use
to the AndroidApplication class, which is based on an Activity.| Modifier and Type | Class and Description |
|---|---|
static interface |
AndroidFragmentApplication.Callbacks
Callbacks interface for letting the fragment interact with the Activitiy, parent fragment or target fragment.
|
androidx.fragment.app.Fragment.InstantiationException, androidx.fragment.app.Fragment.SavedStateApplication.ApplicationType| Modifier and Type | Field and Description |
|---|---|
android.os.Handler |
handler |
MINIMUM_SDKLOG_DEBUG, LOG_ERROR, LOG_INFO, LOG_NONE| Constructor and Description |
|---|
AndroidFragmentApplication() |
| Modifier and Type | Method and Description |
|---|---|
void |
addAndroidEventListener(AndroidEventListener listener)
Adds an event listener for Android specific event such as onActivityResult(...).
|
void |
addLifecycleListener(LifecycleListener listener) |
AndroidAudio |
createAudio(android.content.Context context,
AndroidApplicationConfiguration config)
Returns the AndroidAudio to be used by the application
|
AndroidInput |
createInput(Application activity,
android.content.Context context,
Object view,
AndroidApplicationConfiguration config)
Returns the AndroidInput to be used by the application
|
void |
debug(String tag,
String message) |
void |
debug(String tag,
String message,
Throwable exception) |
void |
error(String tag,
String message) |
void |
error(String tag,
String message,
Throwable exception) |
void |
exit() |
ApplicationListener |
getApplicationListener() |
ApplicationLogger |
getApplicationLogger() |
android.view.Window |
getApplicationWindow()
Returns the Window associated with the application
|
Audio |
getAudio() |
Clipboard |
getClipboard() |
android.content.Context |
getContext()
The application or activity context
|
Array<Runnable> |
getExecutedRunnables()
The currently executed runnables
|
Files |
getFiles() |
Graphics |
getGraphics() |
android.os.Handler |
getHandler()
Returns the Handler object created by the application
|
AndroidInput |
getInput()
Returns the
AndroidInput object associated with this AndroidApplicationBase |
long |
getJavaHeap() |
SnapshotArray<LifecycleListener> |
getLifecycleListeners()
Returns the
LifecycleListener array associated with this AndroidApplicationBase |
int |
getLogLevel() |
long |
getNativeHeap() |
Net |
getNet() |
Preferences |
getPreferences(String name) |
Array<Runnable> |
getRunnables()
A set of usable runnables
|
Application.ApplicationType |
getType() |
int |
getVersion() |
android.view.WindowManager |
getWindowManager()
Returns the WindowManager associated with the application
|
android.view.View |
initializeForView(ApplicationListener listener)
This method has to be called in the
Fragment.onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle) method. |
android.view.View |
initializeForView(ApplicationListener listener,
AndroidApplicationConfiguration config)
This method has to be called in the
Fragment.onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle) method. |
void |
log(String tag,
String message) |
void |
log(String tag,
String message,
Throwable exception) |
void |
onActivityResult(int requestCode,
int resultCode,
android.content.Intent data) |
void |
onAttach(android.app.Activity activity) |
void |
onConfigurationChanged(android.content.res.Configuration config) |
void |
onDetach() |
void |
onPause() |
void |
onResume() |
void |
postRunnable(Runnable runnable) |
void |
removeAndroidEventListener(AndroidEventListener listener)
Removes an event listener for Android specific event such as onActivityResult(...).
|
void |
removeLifecycleListener(LifecycleListener listener) |
void |
runOnUiThread(Runnable runnable)
Method signifies an intent of the caller to execute some action on the UI Thread.
|
void |
setApplicationLogger(ApplicationLogger applicationLogger) |
void |
setLogLevel(int logLevel) |
void |
useImmersiveMode(boolean use)
Activates Android 4.4 KitKat's 'Immersive Mode' feature.
|
dump, equals, getActivity, getAllowEnterTransitionOverlap, getAllowReturnTransitionOverlap, getArguments, getChildFragmentManager, getDefaultViewModelProviderFactory, getEnterTransition, getExitTransition, getFragmentManager, getHost, getId, getLayoutInflater, getLayoutInflater, getLifecycle, getLoaderManager, getParentFragment, getParentFragmentManager, getReenterTransition, getResources, getRetainInstance, getReturnTransition, getSavedStateRegistry, getSharedElementEnterTransition, getSharedElementReturnTransition, getString, getString, getTag, getTargetFragment, getTargetRequestCode, getText, getUserVisibleHint, getView, getViewLifecycleOwner, getViewLifecycleOwnerLiveData, getViewModelStore, hashCode, hasOptionsMenu, instantiate, instantiate, isAdded, isDetached, isHidden, isInLayout, isMenuVisible, isRemoving, isResumed, isStateSaved, isVisible, onActivityCreated, onAttach, onAttachFragment, onContextItemSelected, onCreate, onCreateAnimation, onCreateAnimator, onCreateContextMenu, onCreateOptionsMenu, onCreateView, onDestroy, onDestroyOptionsMenu, onDestroyView, onGetLayoutInflater, onHiddenChanged, onInflate, onInflate, onLowMemory, onMultiWindowModeChanged, onOptionsItemSelected, onOptionsMenuClosed, onPictureInPictureModeChanged, onPrepareOptionsMenu, onPrimaryNavigationFragmentChanged, onRequestPermissionsResult, onSaveInstanceState, onStart, onStop, onViewCreated, onViewStateRestored, postponeEnterTransition, postponeEnterTransition, registerForContextMenu, requestPermissions, requireActivity, requireArguments, requireContext, requireFragmentManager, requireHost, requireParentFragment, requireView, setAllowEnterTransitionOverlap, setAllowReturnTransitionOverlap, setArguments, setEnterSharedElementCallback, setEnterTransition, setExitSharedElementCallback, setExitTransition, setHasOptionsMenu, setInitialSavedState, setMenuVisibility, setReenterTransition, setRetainInstance, setReturnTransition, setSharedElementEnterTransition, setSharedElementReturnTransition, setTargetFragment, setUserVisibleHint, shouldShowRequestPermissionRationale, startActivity, startActivity, startActivityForResult, startActivityForResult, startIntentSenderForResult, startPostponedEnterTransition, toString, unregisterForContextMenustartActivitypublic void onAttach(android.app.Activity activity)
onAttach in class androidx.fragment.app.Fragmentpublic void onDetach()
onDetach in class androidx.fragment.app.Fragmentpublic void useImmersiveMode(boolean use)
AndroidApplicationBaseuseImmersiveMode in interface AndroidApplicationBaseuse - Whether or not to use immersive modepublic android.view.View initializeForView(ApplicationListener listener)
Fragment.onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle) method. It sets up all
the things necessary to get input, render via OpenGL and so on. Uses a default AndroidApplicationConfiguration.
Note: you have to return the returned view from the
Fragment.onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle)!listener - the ApplicationListener implementing the program logicpublic android.view.View initializeForView(ApplicationListener listener, AndroidApplicationConfiguration config)
Fragment.onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle) method. It sets up all
the things necessary to get input, render via OpenGL and so on. You can configure other aspects of the application with the
rest of the fields in the AndroidApplicationConfiguration instance.
Note: you have to return the returned view from
Fragment.onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle)listener - the ApplicationListener implementing the program logicconfig - the AndroidApplicationConfiguration, defining various settings of the application (use accelerometer,
etc.).public void onPause()
onPause in class androidx.fragment.app.Fragmentpublic void onResume()
onResume in class androidx.fragment.app.Fragmentpublic ApplicationListener getApplicationListener()
getApplicationListener in interface Applicationpublic Audio getAudio()
getAudio in interface Applicationpublic Files getFiles()
getFiles in interface Applicationpublic Graphics getGraphics()
getGraphics in interface Applicationpublic AndroidInput getInput()
AndroidApplicationBaseAndroidInput object associated with this AndroidApplicationBasegetInput in interface ApplicationgetInput in interface AndroidApplicationBaseAndroidInput objectpublic Net getNet()
getNet in interface Applicationpublic Application.ApplicationType getType()
getType in interface Applicationpublic int getVersion()
getVersion in interface Applicationpublic long getJavaHeap()
getJavaHeap in interface Applicationpublic long getNativeHeap()
getNativeHeap in interface Applicationpublic Preferences getPreferences(String name)
getPreferences in interface Applicationpublic Clipboard getClipboard()
getClipboard in interface Applicationpublic void postRunnable(Runnable runnable)
postRunnable in interface Applicationpublic void onConfigurationChanged(android.content.res.Configuration config)
onConfigurationChanged in interface android.content.ComponentCallbacksonConfigurationChanged in class androidx.fragment.app.Fragmentpublic void exit()
exit in interface Applicationpublic void debug(String tag, String message)
debug in interface Applicationpublic void debug(String tag, String message, Throwable exception)
debug in interface Applicationpublic void log(String tag, String message)
log in interface Applicationpublic void log(String tag, String message, Throwable exception)
log in interface Applicationpublic void error(String tag, String message)
error in interface Applicationpublic void error(String tag, String message, Throwable exception)
error in interface Applicationpublic void setLogLevel(int logLevel)
setLogLevel in interface Applicationpublic int getLogLevel()
getLogLevel in interface Applicationpublic void setApplicationLogger(ApplicationLogger applicationLogger)
setApplicationLogger in interface Applicationpublic ApplicationLogger getApplicationLogger()
getApplicationLogger in interface Applicationpublic void addLifecycleListener(LifecycleListener listener)
addLifecycleListener in interface Applicationpublic void removeLifecycleListener(LifecycleListener listener)
removeLifecycleListener in interface Applicationpublic android.content.Context getContext()
AndroidApplicationBasegetContext in interface AndroidApplicationBasegetContext in class androidx.fragment.app.FragmentContextpublic Array<Runnable> getRunnables()
AndroidApplicationBasegetRunnables in interface AndroidApplicationBaseRunnable arraypublic Array<Runnable> getExecutedRunnables()
AndroidApplicationBasegetExecutedRunnables in interface AndroidApplicationBaseRunnable arraypublic void runOnUiThread(Runnable runnable)
AndroidApplicationBaserunOnUiThread in interface AndroidApplicationBaserunnable - The runnable to be executedpublic SnapshotArray<LifecycleListener> getLifecycleListeners()
AndroidApplicationBaseLifecycleListener array associated with this AndroidApplicationBasegetLifecycleListeners in interface AndroidApplicationBaseLifecycleListener'spublic void onActivityResult(int requestCode,
int resultCode,
android.content.Intent data)
onActivityResult in class androidx.fragment.app.Fragmentpublic void addAndroidEventListener(AndroidEventListener listener)
public void removeAndroidEventListener(AndroidEventListener listener)
public android.view.Window getApplicationWindow()
AndroidApplicationBasegetApplicationWindow in interface AndroidApplicationBaseWindow associated with the applicationpublic android.os.Handler getHandler()
AndroidApplicationBasegetHandler in interface AndroidApplicationBaseHandler object created by the applicationpublic AndroidAudio createAudio(android.content.Context context, AndroidApplicationConfiguration config)
AndroidApplicationBasecreateAudio in interface AndroidApplicationBaseAndroidAudiopublic AndroidInput createInput(Application activity, android.content.Context context, Object view, AndroidApplicationConfiguration config)
AndroidApplicationBasecreateInput in interface AndroidApplicationBaseAndroidInputpublic android.view.WindowManager getWindowManager()
AndroidApplicationBasegetWindowManager in interface AndroidApplicationBaseWindowManager associated with the applicationCopyright © 2021. All rights reserved.