androidx.core.content
Classes
ContentProviderCompat |
Helper for accessing features in |
ContentResolverCompat |
Helper for accessing features in |
ContextCompat |
Helper for accessing features in |
FileProvider |
FileProvider is a special subclass of |
IntentCompat |
Helper for accessing features in |
LocusIdCompat |
An identifier for an unique state (locus) in the application. |
MimeTypeFilter |
Provides utility methods for matching MIME type filters used in ContentProvider. |
PermissionChecker |
This class provides permission check APIs that verify both the permission and the associated app op for this permission if such is defined. |
SharedPreferencesCompat |
Top-level functions summary
ContentValues |
contentValuesOf(vararg pairs: Pair<String, Any?>) Returns a new ContentValues with the given key/value pairs as elements. |
Extension functions summary
For android.content.Context | |
T? |
Return the handle to a system-level service by class. |
Unit |
Context.withStyledAttributes(set: AttributeSet? = null, attrs: IntArray, @AttrRes defStyleAttr: Int = 0, @StyleRes defStyleRes: Int = 0, block: TypedArray.() -> Unit) Executes block on a TypedArray receiver. |
Unit |
Context.withStyledAttributes(@StyleRes resourceId: Int, attrs: IntArray, block: TypedArray.() -> Unit) Executes block on a TypedArray receiver. |
For android.content.SharedPreferences | |
Unit |
SharedPreferences.edit(: Boolean = false, : Editor.() -> Unit) Allows editing of this preference instance with a call to apply or commit to persist the changes. |
Top-level functions
contentValuesOf
fun contentValuesOf(vararg pairs: Pair<String, Any?>): ContentValues
Returns a new ContentValues with the given key/value pairs as elements.
Exceptions | |
---|---|
IllegalArgumentException |
When a value is not a supported type of ContentValues. |
Extension functions
edit
inline fun SharedPreferences.edit(
: Boolean = false,
: Editor.() -> Unit
): Unit
Allows editing of this preference instance with a call to apply or commit to persist the changes. Default behaviour is apply.
prefs.edit { putString("key", value) }
To commit changes:
prefs.edit(commit = true) { putString("key", value) }
getSystemService
inline fun <reified T : Any> Context.getSystemService(): T?
Return the handle to a system-level service by class.
See Also
withStyledAttributes
inline fun Context.withStyledAttributes(
set: AttributeSet? = null,
attrs: IntArray,
@AttrRes defStyleAttr: Int = 0,
@StyleRes defStyleRes: Int = 0,
block: TypedArray