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?)
android

Inherited functions

From android.app.Activity
open Unit
android
open Unit
android
open Unit
android
open Unit
android
open PendingIntent
createPendingResult(p0: Int, p1: Intent, p2: Int)
android
Unit

This function is deprecated. Deprecated in Java

android
Unit
android
open Boolean
android
open Boolean
android
open Boolean
android
open Boolean
android
open Unit
dump(p0: String, p1: FileDescriptor?, p2: PrintWriter, p3: Array<String>?)
android
open Unit

This function is deprecated. Deprecated in Java

android
open Boolean
android
open T
<T : View> findViewById(p0: Int)
android
open Unit
android
open Unit
android
open Unit

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 ActionBar?
android
Application
android
open ComponentName?
android
open String?
android
open Int
android
open ComponentName
android
open Scene
android
open TransitionManager
android
open View?
android
open FragmentManager

This function is deprecated. Deprecated in Java

android
open Intent
android
open Any?
android
open String?
android
open Int
android
open LayoutInflater
android
open LoaderManager

This function is deprecated. Deprecated in Java

android
open String
android
open Int
android
MediaController
android
open MenuInflater
android
open OnBackInvokedDispatcher
android
Activity
android
open Intent?
android
open SharedPreferences
android
open Uri?
android
open Int
android
SearchEvent
android
SplashScreen
android
open Any
android
open Int
android
CharSequence
android
Int
android
open VoiceInteractor
android
Int
android
open Window
android
open WindowManager
android
open Boolean
android
open Unit
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
Cursor
managedQuery(
    p0: Uri,
    p1: Array<String>,
    p2: String,
    p3: Array<String>,
    p4: String
)

This function is deprecated. Deprecated in Java

android
open Boolean
android
open Boolean
android
open Boolean

This function is deprecated. Deprecated in Java

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

This function is deprecated. Deprecated in Java

android
open Unit
android
open Unit
android
open Unit
android
open Boolean
android
open Unit
android
open Unit
android
open Unit
onCreateContextMenu(
    p0: ContextMenu,
    p1: View,
    p2: ContextMenu.ContextMenuInfo
)
android
open CharSequence?
android
open Dialog

This function is deprecated. Deprecated in Java

android
open Dialog?

This function is deprecated. Deprecated in Java

android
open Unit
android
open Boolean
android
open View?
android
open Boolean

This function is deprecated. Deprecated in Java

android
open View?
android
open View?
onCreateView(p0: View?, p1: String, p2: Context, p3: AttributeSet)
android
open Unit
android
open Unit
android
open Unit
android
open Boolean
android
open Unit
android
open Boolean
onKeyDown(p0: Int, p1: KeyEvent)
android
open Boolean
android
open Boolean
onKeyMultiple(p0: Int, p1: Int, p2: KeyEvent)
android
open Boolean
android
open Boolean
onKeyUp(p0: Int, p1: KeyEvent)
android
open Unit
android
open Unit
android
open Unit
android
open Boolean
onMenuOpened(p0: Int, p1: Menu)
android
open Boolean
android
open Boolean

This function is deprecated. Deprecated in Java

android
open Boolean
android
open Unit
android
open Unit
android
open Unit
onPerformDirectAction(
    p0: String,
    p1: Bundle,
    p2: CancellationSignal,
    p3: Consumer<Bundle>
)
android
open Boolean
android
open Unit
android
open Unit
android
open Unit
android
open Unit
android
open Unit

This function is deprecated. Deprecated in Java

android
open Unit
onPrepareDialog(p0: Int, p1: Dialog, p2: Bundle)

This function is deprecated. Deprecated in Java

android
open Unit
android
open Boolean
android
open Unit
android
open Unit
android
open Unit
onProvideKeyboardShortcuts(
    p0: MutableList<KeyboardShortcutGroup>,
    p1: Menu?,
    p2: Int
)
android
open Uri
android
open Unit
android
open Unit
android
open Unit
android
open Unit
android
open Unit
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
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 ActionMode?
android
open ActionMode?
android
open Unit
android
open Unit
android
open Unit
android
open Unit
overrideActivityTransition(p0: Int, p1: Int, p2: Int, p3: Int)
android
open Unit

This function is deprecated. Deprecated in Java

android
open Unit
overridePendingTransition(p0: Int, p1: Int, p2: 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 Unit
android
open Boolean
android
Unit

This function is deprecated. Deprecated in Java

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

This function is deprecated. Deprecated in Java

android
Boolean
android
T
<T : View> requireViewById(p0: Int)
android
Unit
android
open Unit
android
open Unit
android
Unit
android
open Unit
android
open Unit
android
Unit
android
Unit
android
Unit
android
Unit
android
open Unit
android
open Unit
android
open Unit
android
open Unit
android
open Unit
android
Unit
android
open Unit
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
Unit

This function is deprecated. Deprecated in Java

android
open Unit
android
open Unit
android
Unit
android
Unit
setResult(p0: Int, p1: Intent)
android
Unit

This function is deprecated. Deprecated in Java

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

This function is deprecated. Deprecated in Java

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

This function is deprecated. Deprecated in Java

android
Boolean
showDialog(p0: Int, p1: Bundle)

This function is deprecated. Deprecated in Java

android
open Unit
android
open ActionMode?
android
open ActionMode?
android
open Unit
android
open Unit
android
open Unit
android
open Unit
android
open Unit

This function is deprecated. Deprecated in Java

android
open Unit
startActivityFromChild(p0: Activity, p1: Intent, p2: Int, p3: Bundle?)

This function is deprecated. Deprecated in Java

android
open Unit

This function is deprecated. Deprecated in Java

android
open Unit
startActivityFromFragment(p0: Fragment, p1: Intent, p2: Int, p3: Bundle?)

This function is deprecated. Deprecated in Java

android
open Boolean
android
open Boolean
startActivityIfNeeded(p0: Intent, p1: Int, p2: Bundle?)
android
open Unit
startIntentSender(p0: IntentSender, p1: Intent?, p2: Int, p3: Int, p4: Int)
android
open Unit
startIntentSender(
    p0: IntentSender,
    p1: Intent?,
    p2: Int,
    p3: Int,
    p4: Int,
    p5: Bundle?
)
android
open Unit
startIntentSenderFromChild(
    p0: Activity,
    p1: IntentSender,
    p2: Int,
    p3: Intent,
    p4: Int,
    p5: Int,
    p6: Int
)

This function is deprecated. Deprecated in Java

android
open Unit
startIntentSenderFromChild(
    p0: Activity,
    p1: IntentSender,
    p2: Int,
    p3: Intent,
    p4: Int,
    p5: Int,
    p6: Int,
    p7: 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
android
open Unit
android
open Unit
startSearch(p0: String?, p1: Boolean, p2: Bundle?, p3: Boolean)
android
open Unit
android
open Unit
android
open Unit

This function is deprecated. Deprecated in Java

android
open Unit
android
open Unit
android
open Unit
android
open Unit
android
open Unit
android
open Unit
android
From androidx.activity.ComponentActivity
open Unit
android
open Unit
android
open Unit
android
open Unit
addMenuProvider(
    provider: MenuProvider,
    owner: LifecycleOwner,
    state: Lifecycle.State
)
android
final Unit
android
final Unit
android
final Unit
android
final Unit
android
final Unit
android
final Unit
android
final Unit
android
open Unit
android
open Unit
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
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
)
android
open Unit
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
)
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?
android
open Unit
android
open Unit
android
open Unit
android
open Context?
android
final ActivityResultLauncher<I>
<I : Any?, O : Any?> registerForActivityResult(
    contract: ActivityResultContract<I, O>,
    callback: ActivityResultCallback<O>
)
android
final ActivityResultLauncher<I>
<I : Any?, O : Any?> registerForActivityResult(
    contract: ActivityResultContract<I, O>,
    registry: ActivityResultRegistry,
    callback: ActivityResultCallback<O>
)
android
open Unit
android
final Unit
android
final Unit
android
final Unit
android
final Unit
android
final Unit
android
final Unit
android
final Unit
android
open Unit
android
open Unit
setContentView(layoutResID: @LayoutRes Int)
android
open Unit
android
open Unit
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.Context
open Boolean
bindIsolatedService(
    p0: Intent,
    p1: Context.BindServiceFlags,
    p2: String,
    p3: Executor,
    p4: ServiceConnection
)
android
Int
android
ColorStateList
android
Drawable?
android
String
android
String
getString(p0: Int, vararg p1: Any)
android
T
<T : Any> getSystemService(p0: Class<T>)
android
CharSequence
getText(p0: Int)
android
TypedArray
android
TypedArray
android
TypedArray
android
TypedArray
obtainStyledAttributes(p0: AttributeSet?, p1: IntArray, p2: Int, p3: Int)
android
open Unit
android
open Unit
android
From android.view.ContextThemeWrapper
open Unit
android
open AssetManager
android
open Resources
android
open Resources.Theme
android
open Unit
android
From android.content.ContextWrapper
open Boolean
bindIsolatedService(
    p0: Intent,
    p1: Int,
    p2: String,
    p3: Executor,
    p4: ServiceConnection
)
android
open Boolean
bindService(
    p0: Intent,
    p1: ServiceConnection,
    p2: Context.BindServiceFlags
)
android
open Boolean
android
open Boolean
bindService(
    p0: Intent,
    p1: Context.BindServiceFlags,
    p2: Executor,
    p3: ServiceConnection
)
android
open Boolean
bindService(p0: Intent, p1: Int, p2: Executor, p3: ServiceConnection)
android
open Boolean
bindServiceAsUser(
    p0: Intent,
    p1: ServiceConnection,
    p2: Context.BindServiceFlags,
    p3: UserHandle
)
android
open Boolean
android
open Int
android
open Int
android
open IntArray
android
open Int
android
open Int
android
open IntArray
android
open Int
checkPermission(p0: String, p1: Int, p2: Int)
android
open Int
android
open Int
checkUriPermission(p0: Uri, p1: Int, p2: Int, p3: Int)
android
open Int
checkUriPermission(p0: Uri?, p1: String?, p2: String?, p3: Int, p4: Int, p5: Int)
android
open IntArray
checkUriPermissions(p0: MutableList<Uri>, p1: Int, p2: Int, p3: Int)
android
open Unit

This function is deprecated. Deprecated in Java

android
open Context
android
open Context
android
open Context
android
open Context
android
open Context
android
open Context
android
open Context
android
open Context
android
open Context
android
open Context
createWindowContext(p0: Display, p1: Int, p2: Bundle?)
android
open Array<String>
android
open Boolean
android
open Boolean
android
open Boolean
android
open Unit
android
open Unit
android
open Unit
android
open Unit
android
open Unit
enforcePermission(p0: String, p1: Int, p2: Int, p3: String?)
android
open Unit
enforceUriPermission(p0: Uri, p1: Int, p2: Int, p3: Int, p4: String)
android
open Unit
enforceUriPermission(
    p0: Uri?,
    p1: String?,
    p2: String?,
    p3: Int,
    p4: Int,
    p5: Int,
    p6: String?
)
android
open Array<String>
android
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 File
android
open Int
android
open File
getDir(p0: String, p1: Int)
android
open Display?
android
open File?
android
open Array<File>
android
open File?
android
open Array<File>
android
open Array<File>
android
open File
android
open File
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 SharedPreferences
android
open String?
android
open Drawable

This function is deprecated. Deprecated in Java

android
open Int

This function is deprecated. Deprecated in Java

android
open Int

This function is deprecated. Deprecated in Java

android
open Unit
grantUriPermission(p0: String, p1: Uri, p2: Int)
android
open Boolean
android
open Boolean
android
open Boolean
android
open Boolean
android
open Boolean
android
open FileInputStream
android
open FileOutputStream
android
open SQLiteDatabase
android
open SQLiteDatabase
openOrCreateDatabase(
    p0: String,
    p1: Int,
    p2: SQLiteDatabase.CursorFactory,
    p3: DatabaseErrorHandler?
)
android
open Drawable

This function is deprecated. Deprecated in Java

android
open Unit
android
open Intent?
android
open Intent?
android
open Intent?
registerReceiver(
    p0: BroadcastReceiver?,
    p1: IntentFilter,
    p2: String?,
    p3: Handler?
)
android
open Intent?
registerReceiver(
    p0: BroadcastReceiver?,
    p1: IntentFilter,
    p2: String?,
    p3: Handler?,
    p4: 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(p0: String, p1: Uri, p2: Int)
android
open Unit
android
open Unit
android
open Unit
sendBroadcast(p0: Intent, p1: String?, p2: Bundle?)
android
open Unit
android
open Unit
android
open Unit
android
open Unit
android
open Unit
sendOrderedBroadcast(
    p0: Intent,
    p1: String?,
    p2: BroadcastReceiver?,
    p3: Handler?,
    p4: Int,
    p5: String?,
    p6: Bundle?
)
android
open Unit
sendOrderedBroadcast(
    p0: Intent,
    p1: String?,
    p2: Bundle?,
    p3: BroadcastReceiver?,
    p4: Handler?,
    p5: Int,
    p6: String?,
    p7: Bundle?
)
android
open Unit
sendOrderedBroadcast(
    p0: Intent,
    p1: String?,
    p2: String?,
    p3: BroadcastReceiver?,
    p4: Handler?,
    p5: Int,
    p6: String?,
    p7: Bundle?
)
android
open Unit
sendOrderedBroadcast(
    p0: Intent,
    p1: Int,
    p2: String?,
    p3: String?,
    p4: BroadcastReceiver?,
    p5: Handler?,
    p6: String?,
    p7: Bundle?,
    p8: Bundle?
)
android
open Unit
sendOrderedBroadcastAsUser(
    p0: Intent,
    p1: UserHandle,
    p2: String?,
    p3: BroadcastReceiver?,
    p4: Handler?,
    p5: Int,
    p6: String?,
    p7: Bundle?
)
android
open Unit

This function is deprecated. Deprecated in Java

android
open Unit

This function is deprecated. Deprecated in Java

android
open Unit

This function is deprecated. Deprecated in Java

android
open Unit
sendStickyOrderedBroadcast(
    p0: Intent,
    p1: BroadcastReceiver?,
    p2: Handler?,
    p3: Int,
    p4: String?,
    p5: Bundle?
)

This function is deprecated. Deprecated in Java

android
open Unit
sendStickyOrderedBroadcastAsUser(
    p0: Intent,
    p1: UserHandle,
    p2: BroadcastReceiver?,
    p3: Handler?,
    p4: Int,
    p5: String?,
    p6: Bundle?
)

This function is deprecated. Deprecated in Java

android
open Unit

This function is deprecated. Deprecated in Java

android
open Unit

This function is deprecated. Deprecated in Java

android
open ComponentName?
android
open Boolean
android
open ComponentName?
android
open Boolean
android
open Unit
android
open Unit
android
open Unit
android
open Unit
android
From android.view.Window.Callback
open Unit
android

Inherited properties

From androidx.activity.ComponentActivity
final ActivityResultRegistry
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
android
open Any?
android
open Lifecycle

Returns the Lifecycle of the provider.

android
final OnBackPressedDispatcher
android
final SavedStateRegistry

The SavedStateRegistry owned by this SavedStateRegistryOwner

android
open ViewModelStore

The owned ViewModelStore

android

Public constructors

PreviewActivity

PreviewActivity()

Protected functions

onCreate

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