PreviewActivity


Activity used to run @Composable previews from Android Studio.

The supported @Composable functions either have no parameters, or have only parameters with default values and/or one parameter annotated with @PreviewParameter.

The @Composable fully qualified name must be passed to this Activity through intent parameters, using composable as the key. When deploying Compose Previews with @PreviewParameter annotated parameters, the provider should be specified as an intent parameter as well, using the key parameterProviderClassName. Optionally, parameterProviderIndex can also be set to display a specific provider value instead of all of them.

Summary

Public constructors

android

Protected functions

open Unit
onCreate(savedInstanceState: Bundle?)

{@inheritDoc}

android

Inherited functions

From android.app.Activity
open Unit
android
open Unit
android
open Unit
android
open PendingIntent
createPendingResult(requestCode: Int, data: Intent, flags: Int)
android
Unit

This function is deprecated. Deprecated in Java

android
Unit
android
open Unit
dump(
    prefix: String,
    fd: FileDescriptor?,
    writer: PrintWriter,
    args: Array<String>?
)
android
open Unit

This function is deprecated. Deprecated in Java

android
open Boolean
android
open T
<T : View> findViewById(id: Int)
android
open Unit
android
open Unit
finishActivity(requestCode: Int)
android
open Unit
finishActivityFromChild(child: Activity, requestCode: Int)

This function is deprecated. Deprecated in Java

android
open Unit
android
open Unit
android
open Unit
android
open Unit

This function is deprecated. Deprecated in Java

android
open SharedPreferences
android
open Boolean
android
open Unit
android
Cursor
managedQuery(
    uri: Uri,
    projection: Array<String>,
    selection: String,
    selectionArgs: Array<String>,
    sortOrder: String
)

This function is deprecated. Deprecated in Java

android
open Boolean
android
open Boolean
navigateUpTo(upIntent: Intent)
android
open Boolean
navigateUpToFromChild(child: Activity, upIntent: Intent)

This function is deprecated. Deprecated in Java

android
open Unit
onActivityReenter(resultCode: Int, data: Intent)
android
open Unit
onActivityResult(
    requestCode: Int,
    resultCode: Int,
    data: Intent?,
    caller: ComponentCaller
)
android
open Unit

This function is deprecated. Deprecated in Java

android
open Unit
onChildTitleChanged(childActivity: Activity, title: CharSequence)
android
open Boolean
android
open Unit
android
open Unit
onCreate(savedInstanceState: Bundle?, persistentState: PersistableBundle?)
android
open CharSequence?
android
open Dialog

This function is deprecated. Deprecated in Java

android
open Dialog?
onCreateDialog(id: Int, args: Bundle)

This function is deprecated. Deprecated in Java

android
open Unit
android
open Boolean
android
open Boolean
onCreateThumbnail(outBitmap: Bitmap, canvas: Canvas)

This function is deprecated. Deprecated in Java

android
open Unit
android
open Unit
android
open Boolean
android
open Unit
onGetDirectActions(
    cancellationSignal: CancellationSignal,
    callback: Consumer<MutableList<DirectAction>>
)
android
open Boolean
onKeyShortcut(keyCode: Int, event: KeyEvent)
android
open Unit
android
open Unit
android
open Boolean
android
open Boolean

This function is deprecated. Deprecated in Java

android
open Unit
onNewIntent(intent: Intent, caller: ComponentCaller)
android
open Boolean
android
open Unit
android
open Unit
android
open Unit
onPerformDirectAction(
    actionId: String,
    arguments: Bundle,
    cancellationSignal: CancellationSignal,
    resultListener: Consumer<Bundle>
)
android
open Boolean
android
open Unit
onPostCreate(savedInstanceState: Bundle?)
android
open Unit
onPostCreate(
    savedInstanceState: Bundle?,
    persistentState: PersistableBundle?
)
android
open Unit
android
open Unit
onPrepareDialog(id: Int, dialog: Dialog)

This function is deprecated. Deprecated in Java

android
open Unit
onPrepareDialog(id: Int, dialog: Dialog, args: Bundle)

This function is deprecated. Deprecated in Java

android
open Unit
android
open Boolean
android
open Unit
android
open Unit
android
open Uri
android
open Unit
onRequestPermissionsResult(
    requestCode: Int,
    permissions: Array<String>,
    grantResults: IntArray,
    deviceId: Int
)
android
open Unit
android
open Unit
onRestoreInstanceState(savedInstanceState: Bundle)
android
open Unit
onRestoreInstanceState(
    savedInstanceState: Bundle?,
    persistentState: PersistableBundle?
)
android
open Unit
android
open Unit
onSaveInstanceState(
    outState: Bundle,
    outPersistentState: PersistableBundle
)
android
open Unit
android
open Unit

This function is deprecated. Deprecated in Java

android
open Unit
android
open Unit
onTitleChanged(title: CharSequence, color: Int)
android
open Unit
onTopResumedActivityChanged(isTopResumedActivity: Boolean)
android
open Boolean
android
open Boolean
android
open Unit
android
open Unit

This function is deprecated. Deprecated in Java

android
open Unit
android
open Unit
android
open Unit
overrideActivityTransition(
    overrideType: Int,
    enterAnim: Int,
    exitAnim: Int
)
android
open Unit
overrideActivityTransition(
    overrideType: Int,
    enterAnim: Int,
    exitAnim: Int,
    backgroundColor: Int
)
android
open Unit
overridePendingTransition(enterAnim: Int, exitAnim: Int)

This function is deprecated. Deprecated in Java

android
open Unit
overridePendingTransition(
    enterAnim: Int,
    exitAnim: Int,
    backgroundColor: Int
)

This function is deprecated. Deprecated in Java

android
open Unit
android
open Unit
android
open Unit
android
open Unit
android
open Unit
android
open Boolean
android
Unit

This function is deprecated. Deprecated in Java

android
open DragAndDropPermissions
android
open Unit
requestFullscreenMode(
    request: Int,
    approvalCallback: OutcomeReceiver<VoidThrowable>?
)
android
Unit
android
Unit
requestPermissions(permissions: Array<String>, requestCode: Int)
android
Unit
requestPermissions(
    permissions: Array<String>,
    requestCode: Int,
    deviceId: Int
)
android
Unit
android
open Boolean

This function is deprecated. Deprecated in Java

android
Boolean
android
T
<T : View> requireViewById(id: Int)
android
Unit
android
open Unit
setActionBar(toolbar: Toolbar?)
android
open Unit
android
Unit
android
open Unit
android
open Unit
android
Unit
setFeatureDrawable(featureId: Int, drawable: Drawable)
android
Unit
setFeatureDrawableAlpha(featureId: Int, alpha: Int)
android
Unit
setFeatureDrawableResource(featureId: Int, resId: Int)
android
Unit
setFeatureDrawableUri(featureId: Int, uri: Uri)
android
open Unit
android
open Unit
setInheritShowWhenLocked(inheritShowWhenLocked: Boolean)
android
open Unit
setLocusContext(locusId: LocusId?, bundle: Bundle?)
android
open Unit
android
Unit
setProgress(progress: Int)

This function is deprecated. Deprecated in Java

android
Unit

This function is deprecated. Deprecated in Java

android
Unit

This function is deprecated. Deprecated in Java

android
Unit

This function is deprecated. Deprecated in Java

android
open Unit
android
Unit
setResult(resultCode: Int)
android
Unit
setResult(resultCode: Int, data: Intent)
android
Unit
setSecondaryProgress(secondaryProgress: Int)

This function is deprecated. Deprecated in Java

android
open Unit
setShouldDockBigOverlays(shouldDockBigOverlays: Boolean)
android
open Unit
setShowWhenLocked(showWhenLocked: Boolean)
android
open Unit
android
open Boolean
setTranslucent(translucent: Boolean)
android
open Unit
setTurnScreenOn(turnScreenOn: Boolean)
android
open Unit
setVisible(visible: Boolean)
android
open Unit
setVrModeEnabled(enabled: Boolean, requestedComponent: ComponentName)
android
open Boolean
android
open Boolean
android
open Boolean
android
open Boolean
android
open Boolean
android
Unit

This function is deprecated. Deprecated in Java

android
Boolean
showDialog(id: Int, args: Bundle)

This function is deprecated. Deprecated in Java

android
open Unit
android
open ActionMode?
android
open ActionMode?
android
open Unit
startActivityFromChild(child: Activity, intent: Intent, requestCode: Int)

This function is deprecated. Deprecated in Java

android
open Unit
startActivityFromChild(
    child: Activity,
    intent: Intent,
    requestCode: Int,
    options: Bundle?
)

This function is deprecated. Deprecated in Java

android
open Unit
startActivityFromFragment(
    fragment: Fragment,
    intent: Intent,
    requestCode: Int
)

This function is deprecated. Deprecated in Java

android
open Unit
startActivityFromFragment(
    fragment: Fragment,
    intent: Intent,
    requestCode: Int,
    options: Bundle?
)

This function is deprecated. Deprecated in Java

android
open Boolean
startActivityIfNeeded(intent: Intent, requestCode: Int)
android
open Boolean
startActivityIfNeeded(intent: Intent, requestCode: Int, options: Bundle?)
android
open Unit
startIntentSenderFromChild(
    child: Activity,
    intent: IntentSender,
    requestCode: Int,
    fillInIntent: Intent,
    flagsMask: Int,
    flagsValues: Int,
    extraFlags: Int
)

This function is deprecated. Deprecated in Java

android
open Unit
startIntentSenderFromChild(
    child: Activity,
    intent: IntentSender,
    requestCode: Int,
    fillInIntent: Intent,
    flagsMask: Int,
    flagsValues: Int,
    extraFlags: Int,
    options: Bundle?
)

This function is deprecated. Deprecated in Java

android
open Unit
android
open Unit
android
open Unit

This function is deprecated. Deprecated in Java

android
open Boolean
android
open Boolean
startNextMatchingActivity(intent: Intent, options: Bundle?)
android
open Unit
android
open Unit
startSearch(
    initialQuery: String?,
    selectInitialQuery: Boolean,
    appSearchData: Bundle?,
    globalSearch: Boolean
)
android
open Unit
android
open Unit
android
open Unit

This function is deprecated. Deprecated in Java

android
open Unit
android
open Unit
triggerSearch(query: String, appSearchData: Bundle?)
android
open Unit
android
open Unit
android
open Unit
android
From androidx.activity.ComponentActivity
open Unit
android
open Unit

Adds the given MenuProvider to this MenuHost.

android
open Unit

Adds the given MenuProvider to this MenuHost.

android
open Unit
addMenuProvider(
    provider: MenuProvider,
    owner: LifecycleOwner,
    state: Lifecycle.State
)

Adds the given MenuProvider to this MenuHost once the given LifecycleOwner reaches the given Lifecycle.State.

android
final Unit

Add a new listener that will get a callback associated with ComponentCallbacks.onConfigurationChanged with the new Configuration.

android
final Unit

{@inheritDoc}

android
final Unit

Add a new listener that will get a callback associated with Activity.onMultiWindowModeChanged with the new MultiWindowModeChangedInfo.

android
final Unit

Add a new listener that will get a callback associated with Activity.onNewIntent with the new Intent.

android
final Unit

Add a new listener that will get a callback associated with Activity.onPictureInPictureModeChanged with the new PictureInPictureModeChangedInfo.

android
final Unit

Add a new listener that will get a callback associated with Activity.onPictureInPictureUiStateChanged with the new PictureInPictureUiStateCompat.

android
final Unit

Add a new listener that will get a callback associated with ComponentCallbacks2.onTrimMemory with the int representing the level of trimming.

android
final Unit

Add a new listener that will get a callback associated with Activity.onUserLeaveHint

android
final Unit

Available since API 24 in the framework Activity class, puts the activity in picture-in-picture mode if possible in the current system state.

android
open Unit

Sets the view tree owners before setting the content view so that the inflation process and attach listeners will see them already present.

android
open Unit

Invalidates the android.view.Menu to ensure that what is displayed matches the current internal state of the menu.

android
open Unit
@CallSuper
onActivityResult(requestCode: Int, resultCode: Int, data: Intent?)

This function is deprecated. This method has been deprecated in favor of using the Activity Result API which brings increased type safety via an {@link ActivityResultContract} and the prebuilt contracts for common intents available in {@link androidx.activity.result.contract.ActivityResultContracts}, provides hooks for testing, and allow receiving results in separate, testable classes independent from your activity.

android
open Unit

This function is deprecated. This method has been deprecated in favor of using the {@link OnBackPressedDispatcher} via {@link #getOnBackPressedDispatcher()}.

android
open Unit

{@inheritDoc}

android
open Boolean
onCreatePanelMenu(featureId: Int, menu: Menu)
android
open Boolean
onMenuItemSelected(featureId: Int, item: MenuItem)
android
open Unit

This function is deprecated. Deprecated in android.app.Activity

android
open Unit
@RequiresApi(api = 26)
@CallSuper
onMultiWindowModeChanged(
    isInMultiWindowMode: Boolean,
    newConfig: Configuration
)

{@inheritDoc}

android
open Unit

{@inheritDoc}

android
open Unit
onPanelClosed(featureId: Int, menu: Menu)
android
open Unit
@CallSuper
onPictureInPictureModeChanged(isInPictureInPictureMode: Boolean)

This function is deprecated. Deprecated in android.app.Activity

android
open Unit
@RequiresApi(api = 26)
@CallSuper
onPictureInPictureModeChanged(
    isInPictureInPictureMode: Boolean,
    newConfig: Configuration
)

{@inheritDoc}

android
open Unit

{@inheritDoc}

android
open Boolean
onPreparePanel(featureId: Int, view: View?, menu: Menu)
android
open Unit
@CallSuper
onRequestPermissionsResult(
    requestCode: Int,
    permissions: Array<String>,
    grantResults: IntArray
)

This function is deprecated. This method has been deprecated in favor of using the Activity Result API which brings increased type safety via an {@link ActivityResultContract} and the prebuilt contracts for common intents available in {@link androidx.activity.result.contract.ActivityResultContracts}, provides hooks for testing, and allow receiving results in separate, testable classes independent from your activity.

android
open Any?

This function is deprecated. Use a {@link androidx.lifecycle.ViewModel} to store non config state.

android
final Any?

Retain all appropriate non-config state.

android
open Unit
android
open Unit

{@inheritDoc}

android
open Unit

{@inheritDoc}

android
open Context?

Get the Context if it is currently available.

android
final ActivityResultLauncher<I>
<I : Any?, O : Any?> registerForActivityResult(
    contract: ActivityResultContract<I, O>,
    callback: ActivityResultCallback<O>
)

Register a request to start an activity for result, designated by the given contract.

android
final ActivityResultLauncher<I>
<I : Any?, O : Any?> registerForActivityResult(
    contract: ActivityResultContract<I, O>,
    registry: ActivityResultRegistry,
    callback: ActivityResultCallback<O>
)

Register a request to start an activity for result, designated by the given contract.

android
open Unit

Removes the given MenuProvider from this MenuHost.

android
final Unit

Remove a previously added listener.

android
final Unit

Remove a OnContextAvailableListener previously added via addOnContextAvailableListener.

android
final Unit

Remove a previously added listener.

android
final Unit

Remove a previously added listener.

android
final Unit

Remove a previously added listener.

android
final Unit

Remove a previously added listener.

android
final Unit

Remove a previously added listener.

android
final Unit

Remove a previously added listener.

android
open Unit
android
open Unit
setContentView(layoutResID: @LayoutRes Int)
android
open Unit
android
open Unit
android
final Unit

Available since API 26 in the framework Activity class, updates the properties of the picture-in-picture activity, or sets it to be used later when enterPictureInPictureMode is called

android
open Unit
startActivityForResult(intent: Intent, requestCode: Int)

This function is deprecated. This method has been deprecated in favor of using the Activity Result API which brings increased type safety via an {@link ActivityResultContract} and the prebuilt contracts for common intents available in {@link androidx.activity.result.contract.ActivityResultContracts}, provides hooks for testing, and allow receiving results in separate, testable classes independent from your activity.

android
open Unit
startActivityForResult(intent: Intent, requestCode: Int, options: Bundle?)

This function is deprecated. This method has been deprecated in favor of using the Activity Result API which brings increased type safety via an {@link ActivityResultContract} and the prebuilt contracts for common intents available in {@link androidx.activity.result.contract.ActivityResultContracts}, provides hooks for testing, and allow receiving results in separate, testable classes independent from your activity.

android
open Unit
startIntentSenderForResult(
    intent: IntentSender,
    requestCode: Int,
    fillInIntent: Intent?,
    flagsMask: Int,
    flagsValues: Int,
    extraFlags: Int
)

This function is deprecated. This method has been deprecated in favor of using the Activity Result API which brings increased type safety via an {@link ActivityResultContract} and the prebuilt contracts for common intents available in {@link androidx.activity.result.contract.ActivityResultContracts}, provides hooks for testing, and allow receiving results in separate, testable classes independent from your activity.

android
open Unit
startIntentSenderForResult(
    intent: IntentSender,
    requestCode: Int,
    fillInIntent: Intent?,
    flagsMask: Int,
    flagsValues: Int,
    extraFlags: Int,
    options: Bundle?
)

This function is deprecated. This method has been deprecated in favor of using the Activity Result API which brings increased type safety via an {@link ActivityResultContract} and the prebuilt contracts for common intents available in {@link androidx.activity.result.contract.ActivityResultContracts}, provides hooks for testing, and allow receiving results in separate, testable classes independent from your activity.

android
From android.content.ComponentCallbacks
open Unit
android
From android.content.Context
open Boolean
bindIsolatedService(
    service: Intent,
    flags: Context.BindServiceFlags,
    instanceName: String,
    executor: Executor,
    conn: ServiceConnection
)
android
open Boolean
bindIsolatedService(
    service: Intent,
    flags: Int,
    instanceName: String,
    executor: Executor,
    conn: ServiceConnection
)
android
open Boolean
bindService(
    service: Intent,
    conn: ServiceConnection,
    flags: Context.BindServiceFlags
)
android
open Boolean
bindService(service: Intent, conn: ServiceConnection, flags: Int)
android
open Boolean
bindService(
    service: Intent,
    flags: Context.BindServiceFlags,
    executor: Executor,
    conn: ServiceConnection
)
android
open Boolean
bindService(
    service: Intent,
    flags: Int,
    executor: Executor,
    conn: ServiceConnection
)
android
open Boolean
bindServiceAsUser(
    service: Intent,
    conn: ServiceConnection,
    flags: Context.BindServiceFlags,
    user: UserHandle
)
android
open Boolean
bindServiceAsUser(
    service: Intent,
    conn: ServiceConnection,
    flags: Int,
    user: UserHandle
)
android
open Int
android
open Int
android
open IntArray
android
open Int
android
open Int
checkCallingUriPermission(uri: Uri, modeFlags: Int)
android
open IntArray
android
open Int
checkContentUriPermissionFull(uri: Uri, pid: Int, uid: Int, modeFlags: Int)
android
open Int
checkPermission(permission: String, pid: Int, uid: Int)
android
open Int
android
open Int
checkUriPermission(uri: Uri, pid: Int, uid: Int, modeFlags: Int)
android
open Int
checkUriPermission(
    uri: Uri?,
    readPermission: String?,
    writePermission: String?,
    pid: Int,
    uid: Int,
    modeFlags: Int
)
android
open IntArray
checkUriPermissions(
    uris: MutableList<Uri>,
    pid: Int,
    uid: Int,
    modeFlags: Int
)
android
open Unit

This function is deprecated. Deprecated in Java

android
open Context
createAttributionContext(attributionTag: String?)
android
open Context
createConfigurationContext(overrideConfiguration: Configuration)
android
open Context
createContext(contextParams: ContextParams)
android
open Context
android
open Context
android
open Context
android
open Context
android
open Context
createPackageContext(packageName: String, flags: Int)
android
open Context
createWindowContext(type: Int, options: Bundle?)
android
open Context
createWindowContext(display: Display, type: Int, options: Bundle?)
android
open Array<String>
android
open Boolean
android
open Boolean
android
open Boolean
android
open Unit
enforceCallingOrSelfPermission(permission: String, message: String?)
android
open Unit
enforceCallingOrSelfUriPermission(
    uri: Uri,
    modeFlags: Int,
    message: String
)
android
open Unit
enforceCallingPermission(permission: String, message: String?)
android
open Unit
enforceCallingUriPermission(uri: Uri, modeFlags: Int, message: String)
android
open Unit
enforcePermission(permission: String, pid: Int, uid: Int, message: String?)
android
open Unit
enforceUriPermission(
    uri: Uri,
    pid: Int,
    uid: Int,
    modeFlags: Int,
    message: String
)
android
open Unit
enforceUriPermission(
    uri: Uri?,
    readPermission: String?,
    writePermission: String?,
    pid: Int,
    uid: Int,
    modeFlags: Int,
    message: String?
)
android
open Array<String>
android
Int
android
ColorStateList
android
open File
android
open File
getDir(name: String, mode: Int)
android
Drawable?
android
open File?
android
open Array<File>
android
open File
android
open SharedPreferences
android
String
getString(resId: Int)
android
String
getString(resId: Int, vararg formatArgs: Any)
android
open Any
android
T
<T : Any> getSystemService(serviceClass: Class<T>)
android
open String?
getSystemServiceName(serviceClass: Class<*>)
android
CharSequence
getText(resId: Int)
android
open Unit
grantUriPermission(toPackage: String, uri: Uri, modeFlags: Int)
android
open Boolean
moveDatabaseFrom(sourceContext: Context, name: String)
android
open Boolean
moveSharedPreferencesFrom(sourceContext: Context, name: String)
android
TypedArray
android
TypedArray
android
TypedArray
android
TypedArray
obtainStyledAttributes(
    set: AttributeSet?,
    attrs: IntArray,
    defStyleAttr: Int,
    defStyleRes: Int
)
android
open FileInputStream
android
open FileOutputStream
openFileOutput(name: String, mode: Int)
android
open SQLiteDatabase
openOrCreateDatabase(
    name: String,
    mode: Int,
    factory: SQLiteDatabase.CursorFactory
)
android
open SQLiteDatabase
openOrCreateDatabase(
    name: String,
    mode: Int,
    factory: SQLiteDatabase.CursorFactory,
    errorHandler: DatabaseErrorHandler?
)
android
open Drawable

This function is deprecated. Deprecated in Java

android
open Unit
android
open Unit
android
open Intent?
android
open Intent?
registerReceiver(
    receiver: BroadcastReceiver?,
    filter: IntentFilter,
    flags: Int
)
android
open Intent?
registerReceiver(
    receiver: BroadcastReceiver?,
    filter: IntentFilter,
    broadcastPermission: String?,
    scheduler: Handler?
)
android
open Intent?
registerReceiver(
    receiver: BroadcastReceiver?,
    filter: IntentFilter,
    broadcastPermission: String?,
    scheduler: Handler?,
    flags: Int
)
android
open Unit

This function is deprecated. Deprecated in Java

android
open Unit

This function is deprecated. Deprecated in Java

android
open Unit
android
open Unit
android
open Unit
revokeUriPermission(uri: Uri, modeFlags: Int)
android
open Unit
revokeUriPermission(targetPackage: String, uri: Uri, modeFlags: Int)
android
open Unit
android
open Unit
sendBroadcast(intent: Intent, receiverPermission: String?)
android
open Unit
sendBroadcast(intent: Intent, receiverPermission: String?, options: Bundle?)
android
open Unit
android
open Unit
sendBroadcastAsUser(
    intent: Intent,
    user: UserHandle,
    receiverPermission: String?
)
android
open Unit
sendBroadcastWithMultiplePermissions(
    intent: Intent,
    receiverPermissions: Array<String>
)
android
open Unit
sendOrderedBroadcast(intent: Intent, receiverPermission: String?)
android
open Unit
sendOrderedBroadcast(
    intent: Intent,
    receiverPermission: String?,
    options: Bundle?
)
android
open Unit
sendOrderedBroadcast(
    intent: Intent,
    receiverPermission: String?,
    resultReceiver: BroadcastReceiver?,
    scheduler: Handler?,
    initialCode: Int,
    initialData: String?,
    initialExtras: Bundle?
)
android
open Unit
sendOrderedBroadcast(
    intent: Intent,
    receiverPermission: String?,
    options: Bundle?,
    resultReceiver: BroadcastReceiver?,
    scheduler: Handler?,
    initialCode: Int,
    initialData: String?,
    initialExtras: Bundle?
)
android
open Unit
sendOrderedBroadcast(
    intent: Intent,
    receiverPermission: String?,
    receiverAppOp: String?,
    resultReceiver: BroadcastReceiver?,
    scheduler: Handler?,
    initialCode: Int,
    initialData: String?,
    initialExtras: Bundle?
)
android
open Unit
sendOrderedBroadcastAsUser(
    intent: Intent,
    user: UserHandle,
    receiverPermission: String?,
    resultReceiver: BroadcastReceiver?,
    scheduler: Handler?,
    initialCode: Int,
    initialData: String?,
    initialExtras: Bundle?
)
android
open Unit

This function is deprecated. Deprecated in Java

android
open Unit
sendStickyBroadcast(intent: Intent, options: Bundle?)

This function is deprecated. Deprecated in Java

android
open Unit

This function is deprecated. Deprecated in Java

android
open Unit
sendStickyOrderedBroadcast(
    intent: Intent,
    resultReceiver: BroadcastReceiver?,
    scheduler: Handler?,
    initialCode: Int,
    initialData: String?,
    initialExtras: Bundle?
)

This function is deprecated. Deprecated in Java

android
open Unit
sendStickyOrderedBroadcastAsUser(
    intent: Intent,
    user: UserHandle,
    resultReceiver: BroadcastReceiver?,
    scheduler: Handler?,
    initialCode: Int,
    initialData: String?,
    initialExtras: Bundle?
)

This function is deprecated. Deprecated in Java

android
open Unit
setTheme(resid: Int)
android
open Unit

This function is deprecated. Deprecated in Java

android
open Unit

This function is deprecated. Deprecated in Java

android
open Unit
android
open Unit
startActivities(intents: Array<Intent>, options: Bundle?)
android
open Unit
android
open Unit
startActivity(intent: Intent, options: Bundle?)
android
open ComponentName?
android
open Boolean
startInstrumentation(
    className: ComponentName,
    profileFile: String?,
    arguments: Bundle?
)
android
open Unit
startIntentSender(
    intent: IntentSender,
    fillInIntent: Intent?,
    flagsMask: Int,
    flagsValues: Int,
    extraFlags: Int
)
android
open Unit
startIntentSender(
    intent: IntentSender,
    fillInIntent: Intent?,
    flagsMask: Int,
    flagsValues: Int,
    extraFlags: Int,
    options: Bundle?
)
android
open ComponentName?
startService(service: Intent)
android
open Boolean
android
open Unit
android
open Unit
android
open Unit
android
open Unit
android
open Unit
updateServiceGroup(conn: ServiceConnection, group: Int, importance: Int)
android
From android.view.ContextThemeWrapper
open Unit
applyOverrideConfiguration(overrideConfiguration: Configuration)
android
open Unit
onApplyThemeResource(theme: Resources.Theme, resid: Int, first: Boolean)
android
From android.content.ContextWrapper
open Unit
android
open Unit
sendOrderedBroadcast(
    intent: Intent,
    initialCode: Int,
    receiverPermission: String?,
    receiverAppOp: String?,
    resultReceiver: BroadcastReceiver?,
    scheduler: Handler?,
    initialData: String?,
    initialExtras: Bundle?,
    options: Bundle?
)
android
From android.view.KeyEvent.Callback
open Boolean
onKeyDown(keyCode: Int, event: KeyEvent)
android
open Boolean
onKeyLongPress(keyCode: Int, event: KeyEvent)
android
open Boolean
onKeyMultiple(keyCode: Int, repeatCount: Int, event: KeyEvent)
android
open Boolean
onKeyUp(keyCode: Int, event: KeyEvent)
android
From android.view.LayoutInflater.Factory
open View?
onCreateView(name: String, context: Context, attrs: AttributeSet)
android
From android.view.LayoutInflater.Factory2
open View?
onCreateView(
    parent: View?,
    name: String,
    context: Context,
    attrs: AttributeSet
)
android
From android.view.View.OnCreateContextMenuListener
open Unit
onCreateContextMenu(
    menu: ContextMenu,
    v: View,
    menuInfo: ContextMenu.ContextMenuInfo
)
android
From android.view.Window.Callback
open Boolean
android
open Boolean
android
open Boolean
android
open Boolean
android
open Unit
android
open Unit
android
open Unit
android
open Unit
android
open View?
onCreatePanelView(featureId: Int)
android
open Unit
android
open Boolean
onMenuOpened(featureId: Int, menu: Menu)
android
open Unit
android
open Unit
onProvideKeyboardShortcuts(
    data: MutableList<KeyboardShortcutGroup>,
    menu: Menu?,
    deviceId: Int
)
android
open Boolean
android
open Boolean
android
open Unit
android
open Unit
android
open ActionMode?
android
open ActionMode?
android

Inherited properties

From android.app.Activity
open ActionBar?
android
Application
android
open ComponentCaller?
android
open ComponentName?
android
open String?
android
open Int
android
open ComponentName
android
open Scene
android
open TransitionManager
android
open ComponentCaller
android
open View?
android
open FragmentManager
android
open ComponentCaller
android
open Intent
android
open Boolean
android
open Boolean
android
Boolean
android
open Boolean
android
open Boolean
android
open Boolean
android
open Boolean
android
open Boolean
android
open Boolean
android
open Boolean
android
open Boolean
android
open Boolean
android
open Boolean
android
open Any?
android
open String?
android
open Int
android
open LayoutInflater
android
open LoaderManager
android
open String
android
open Int
android
MediaController
android
open MenuInflater
android
open OnBackInvokedDispatcher
android
Activity
android
open Intent?
android
open Uri?
android
open Int
android
SearchEvent
android
SplashScreen
android
open Int
android
CharSequence
android
Int
android
open VoiceInteractor
android
Int
android
open Window
android
open WindowManager
android
From androidx.activity.ComponentActivity
final ActivityResultRegistry

Get the ActivityResultRegistry associated with this activity.

android
open CreationExtras

Returns the default CreationExtras that should be passed into ViewModelProvider.Factory.create when no overriding CreationExtras were passed to the ViewModelProvider constructors.

android
open ViewModelProvider.Factory

Returns the default ViewModelProvider.Factory that should be used when no custom Factory is provided to the ViewModelProvider constructors.

android
open FullyDrawnReporter

Retrieve the FullyDrawnReporter that should handle the independent parts of the UI that separately report that they are fully drawn.

android
open Any?
android
open Lifecycle

{@inheritDoc}

android
open NavigationEventDispatcher

Lazily provides a NavigationEventDispatcher for back navigation handling, including support for predictive back gestures introduced in Android 13 (API 33+).

android
final OnBackPressedDispatcher

Retrieve the OnBackPressedDispatcher that will be triggered when onBackPressed is called.

android
final SavedStateRegistry

The SavedStateRegistry owned by this SavedStateRegistryOwner

android
open ViewModelStore

The owned ViewModelStore

android
From android.view.ContextThemeWrapper
open AssetManager
android
open Resources
android
open Resources.Theme
android
From android.content.ContextWrapper
open Context
android
open ApplicationInfo
android
open AttributionSource
android
open String?
android
open Context
android
open File
android
open ClassLoader
android
open File
android
open ContentResolver
android
open File
android
open Int
android
open Display
android
open File?
android
open Array<File>
android
open Array<File>
android
open File
android
open Boolean
android
open Boolean
android
open Boolean
android
open Executor
android
open Looper
android
open File
android
open File
android
open Array<File>
android
open String
android
open String
android
open PackageManager
android
open String
android
open String
android
open ContextParams?
android
open Drawable
android
open Int
android
open Int
android

Public constructors

PreviewActivity

PreviewActivity()

Protected functions

onCreate

protected open fun onCreate(savedInstanceState: Bundle?): Unit

{@inheritDoc}

If your ComponentActivity is annotated with ContentView, this will call setContentView for you.