ILifecycle, Contextpublic class FractionAbility extends Ability
Ability that wants to implement Fraction.
You must inherit this class if you want to use fractions in your abilities.SystemCapability.Aafwk#ABILITYAbility.LayoutParamsHelper, Ability.WindowAttributeHelperFORM_INVISIBLE, FORM_VISIBLECONTEXT_IGNORE_SECURITY, CONTEXT_INCLUDE_CODE, CONTEXT_RESOUCE_ONLY, CONTEXT_RESTRICTED, MODE_APPEND, MODE_PRIVATE| 构造器 | 说明 |
|---|---|
FractionAbility() |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
FractionManager |
getFractionManager() |
Obtains the
FractionManager for managing fractions in this ability. |
protected void |
onActive() |
Called back when an ability enters the ACTIVE state.
|
protected void |
onBackground() |
Called back when an ability enters the BACKGROUND state.
|
protected void |
onBackPressed() |
Called back when the Back key is pressed.
|
protected void |
onForeground(Intent intent) |
Called back when the state of an ability changes from BACKGROUND to INACTIVE.
|
protected void |
onInactive() |
Called back when an ability enters the INACTIVE state (an ability in this state is not interactive and may
change to the BACKGROUND or ACTIVE state).
|
protected void |
onPostStart(PacMap pacMap) |
Called when the ability has been started by calling
onStart(ohos.aafwk.content.Intent) and onRestoreAbilityState(ohos.utils.PacMap). |
void |
onRestoreAbilityState(PacMap inState) |
Restores data and states of an ability when it is restored by the system.
|
void |
onSaveAbilityState(PacMap outState) |
Saves temporary data and states of this ability.
|
protected void |
onStart(Intent intent) |
Called back when an ability is started for initialization (it can be called only once in the entire lifecycle of
an ability).
|
protected void |
onStop() |
Called back before an ability is destroyed.
|
addActionRoute, batchInsert, call, cancelBackgroundRunning, connectAbility, continueAbility, continueAbility, continueAbilityReversibly, continueAbilityReversibly, createPipeFile, delete, denormalizeUri, disconnectAbility, dispatchAccessibilityEventInfo, executeBatch, executeOperation, findComponentById, getAbilityName, getAbilityPackage, getAdmissionTransitionConcurEnabled, getAdmissionTransitionObject, getAVController, getBackTransitionConcurEnabled, getBackTransitionObject, getContinuationRegisterManager, getContinuationState, getCurrentFocus, getFileTypes, getIntent, getLayoutParams, getLifecycle, getOriginalDeviceId, getQuitTransitionObject, getReadmissionTransitionObject, getSharedItemAdmissionTransitionObject, getSharedItemBackTransitionObject, getSharedItemQuitTransitionObject, getSharedItemReadmissionTransitionObject, getState, getType, getVolumeTypeAdjustedByKey, getWindow, hasWindowFocus, insert, isTemporary, isTerminating, keepBackgroundRunning, normalizeUri, onAbilityResult, onAcquireFormState, onCastTempForm, onCommand, onCommand, onConfigurationUpdated, onConnect, onCreateForm, onCreateForm, onDeleteForm, onDeleteForm, onDisconnect, onEventDispatch, onEventNotify, onHotkeyTriggered, onInitialized, onKeyDown, onKeyPressAndHold, onKeyUp, onLeaveForeground, onMemoryLevel, onMissionDeleted, onNewDescription, onNewIntent, onOrientationChanged, onPostActive, onReconnect, onRequestPermissionsFromUserResult, onSetCaller, onStoreDataWhenConfigChange, onTopActiveAbilityChanged, onTouchEvent, onTriggerFormEvent, onTriggerFormEvent, onUnloadForm, onUpdateForm, onUpdateForm, onWindowFocusChanged, openFile, openRawFile, parsePredictionArgsReference, parseValuesBucketReference, postTask, query, reload, reverseContinueAbility, setAbilitySliceAnimator, setAdmissionTransitionConcurEnabled, setAdmissionTransitionObject, setAVController, setBackTransitionConcurEnabled, setBackTransitionObject, setFormNextRefreshTime, setIntent, setIsAmbientMode, setLayoutParams, setMainRoute, setQuitTransitionObject, setReadmissionTransitionObject, setResult, setSharedItemAdmissionTransitionObject, setSharedItemBackTransitionObject, setSharedItemQuitTransitionObject, setSharedItemReadmissionTransitionObject, setSwipeToDismiss, setUIContent, setUIContent, setVolumeTypeAdjustedByKey, setWindowBackgroundColor, shutdown, startAbility, startAbility, startAbility, startAbility, startAbilityForResult, startAbilityForResult, startAssistAbility, stopAbility, stopAssistAbility, supportHighPerformanceUI, terminateAbility, update, updateForm, updateForm, updateForm, updateFormattachBaseContext, canRequestPermission, compelVerifyCallerPermission, compelVerifyCallerUriPermission, compelVerifyPermission, compelVerifyPermission, compelVerifyUriPermission, compelVerifyUriPermission, compelVerifyUriPermission, createBundleContext, createParallelTaskDispatcher, createSerialTaskDispatcher, deleteFile, displayUnlockMissionMessage, getAbilityInfo, getAbilityManager, getAbilityPackageContext, getApplicationContext, getApplicationInfo, getAppType, getBundleCodePath, getBundleManager, getBundleName, getBundleResourcePath, getCacheDir, getCaller, getCallingAbility, getCallingBundle, getClassloader, getCodeCacheDir, getColor, getColorMode, getContext, getDatabaseDir, getDataDir, getDir, getDisplayOrientation, getDistributedDir, getElementName, getExternalCacheDir, getExternalCacheDirs, getExternalFilesDir, getExternalFilesDirs, getExternalMediaDirs, getFilesDir, getGlobalTaskDispatcher, getHapModuleInfo, getIntArray, getLastStoredDataWhenConfigChanged, getLocalClassName, getMainTaskDispatcher, getNoBackupFilesDir, getPattern, getPreferencesDir, getProcessInfo, getProcessName, getResourceManager, getResourceManager, getString, getString, getStringArray, getTheme, getThemeId, getUITaskDispatcher, init, isCredentialEncryptedStorage, isDeviceEncryptedStorage, isUpdatingConfigurations, lockMission, printDrawnCompleted, requestPermissionsFromUser, restart, setColorMode, setDisplayOrientation, setPattern, setShowOnLockScreen, setTheme, setTransitionAnimation, setWakeUpScreen, startAbilities, startAbility, startAbility, startAbility, switchToCredentialEncryptedStorageContext, switchToDeviceEncryptedStorageContext, terminateAbility, terminateAbilityResult, unlockMission, verifyCallingOrSelfPermission, verifyCallingPermission, verifyPermission, verifySelfPermissionpublic FractionManager getFractionManager()
FractionManager for managing fractions in this ability.FractionManager instance.protected void onPostStart(PacMap pacMap)
onStart(ohos.aafwk.content.Intent) and onRestoreAbilityState(ohos.utils.PacMap).
Generally, this method is used for system classes to perform final initialization operations after an application starts. You do not need to implement this method for your application. When overriding this method, you must call the implementation of its parent class. Otherwise, an exception will be thrown.
onPostStart 在类中 AbilitypacMap - Indicates the data most recently provided in onSaveAbilityState(ohos.utils.PacMap).protected void onStart(Intent intent)
Most initialization operations should be performed by calling this method. For example, you can use the
current method to call Ability.setMainRoute(java.lang.String) and
Ability.addActionRoute(java.lang.String,java.lang.String) to set the main router and action router for a Page ability.
protected void onActive()
The ability in the ACTIVE state is in the foreground and is interactive.
protected void onBackground()
A Page ability in the BACKGROUND state is invisible. You are advised to suspend threads related to the ability and clear some resources to free up system memory.
onBackground 在类中 Abilityprotected void onInactive()
INACTIVE is an intermediate state and does not last for a long period of time. Frequent switching between ACTIVE and INACTIVE is possible. Therefore, you can use this method to perform certain simple operations, for example, committing any changes.
onInactive 在类中 Abilityprotected void onStop()
This method indicates the end of the ability lifecycle. It can be executed after the ability calls the
Ability.terminateAbility() method or the last ability slice of the ability calls the
AbilitySlice#terminate() method. Generally, this method is used to clear resources.
protected void onForeground(Intent intent)
This is an intermediate state callback method. Generally, the system calls this method to refresh data status
and then calls back the onActive() method.
onForeground 在类中 Abilityintent - Indicates information carried when the ability returns to the INACTIVE state.public void onSaveAbilityState(PacMap outState)
This method is called when the system determines that the ability may be destroyed in an unexpected situation, for example, when the screen orientation changes or the user touches the Home key. Generally, this method is used only to save temporary states.
onSaveAbilityState 在类中 AbilityoutState - Indicates the PacMap object used for storing user data and states. This
parameter cannot be null.public void onRestoreAbilityState(PacMap inState)
This method is called if an ability was destroyed at a certain time due to resource reclaim or was
unexpectedly destroyed and the onSaveAbilityState(ohos.utils.PacMap) method was called to save its user data and
states. Generally, this method is called after the onStart(ohos.aafwk.content.Intent) method.
onRestoreAbilityState 在类中 AbilityinState - Indicates the PacMap object used for storing data and states. This
parameter can not be null.protected void onBackPressed()
The default implementation destroys the ability. You can override this method.
onBackPressed 在类中 Ability