Google は、黒人コミュニティに対する人種平等の促進に取り組んでいます。取り組みを見る

androidx.core.os

Interfaces

OnCancelListener

Listens for cancellation.

ParcelableCompatCreatorCallbacks

Callbacks a Parcelable creator should implement.

Classes

BuildCompat

This class contains additional platform version checking methods for targeting pre-release versions of Android.

CancellationSignal

Static library support version of the framework's android.os.CancellationSignal.

ConfigurationCompat

Helper class which allows access to properties of Configuration in a backward compatible fashion.

EnvironmentCompat

Helper for accessing features in Environment.

HandlerCompat

Helper for accessing features in Handler.

HandlerExecutor

An adapter Executor that posts all executed tasks onto the given Handler.

LocaleListCompat

Helper for accessing features in LocaleList.

MessageCompat

Helper for accessing features in Message.

ParcelableCompat

Helper for accessing features in android.os.Parcelable.

ParcelCompat

Helper for accessing features in Parcel.

ProcessCompat

Helper for accessing features in Process.

TraceCompat

Writes trace events to the system trace buffer.

UserManagerCompat

Helper for accessing features in android.os.UserManager in a backwards compatible fashion.

Exceptions

OperationCanceledException

An exception type that is thrown when an operation in progress is canceled.

Top-level functions summary

Bundle
bundleOf(vararg pairs: Pair<String, Any?>)

Returns a new Bundle with the given key/value pairs as elements.

PersistableBundle
persistableBundleOf(vararg pairs: Pair<String, Any?>)

Returns a new PersistableBundle with the given key/value pairs as elements.

T
trace(sectionName: String, block: () -> T)

Wrap the specified block in calls to Trace.beginSection (with the supplied sectionName) and Trace.endSection.

Extension functions summary

For android.os.Handler
Runnable
Handler.postAtTime(uptimeMillis: Long, token: Any? = null, crossinline action: () -> Unit)

Version of Handler.postAtTime which re-orders the parameters, allowing the action to be placed outside of parentheses.

Runnable
Handler.postDelayed(delayInMillis: Long, token: Any? = null, crossinline action: () -> Unit)

Version of Handler.postDelayed which re-orders the parameters, allowing the action to be placed outside of parentheses.

Top-level functions

bundleOf

fun bundleOf(vararg pairs: Pair<String, Any?>): Bundle

Returns a new Bundle with the given key/value pairs as elements.

Exceptions
IllegalArgumentException When a value is not a supported type of Bundle.

persistableBundleOf

@RequiresApi(21) fun persistableBundleOf(vararg pairs: Pair<String, Any?>): PersistableBundle

Returns a new PersistableBundle with the given key/value pairs as elements.

Exceptions
IllegalArgumentException When a value is not a supported type of PersistableBundle.

trace

inline fun <T> trace(
    sectionName: String,
    block: () -> T
): T

Deprecated.

Wrap the specified block in calls to Trace.beginSection (with the supplied sectionName) and Trace.endSection.

Extension functions

postAtTime

inline fun Handler.postAtTime(
    uptimeMillis: Long,
    token: Any? = null,
    crossinline action: () -> Unit
): Runnable

Version of Handler.postAtTime which re-orders the parameters, allowing the action to be placed outside of parentheses.

handler.postAtTime(200) {
    doSomething()
}
Parameters
token: Any? = null An optional object with which the posted message will be associated.
Return
the created Runnable

postDelayed

inline fun Handler.postDelayed(
    delayInMillis: Long,
    token: Any? = null,
    crossinline action: () -> Unit
): Runnable

Version of Handler.postDelayed which re-orders the parameters, allowing the action to be placed outside of parentheses.

handler.postDelayed(200) {
    doSomething()
}
Return
the created Runnable