Settings.System.GetLong Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
GetLong(ContentResolver, String) |
Convenience function for retrieving a single system settings value
as a |
GetLong(ContentResolver, String, Int64) |
Convenience function for retrieving a single system settings value
as a |
GetLong(ContentResolver, String)
Convenience function for retrieving a single system settings value
as a long
.
[Android.Runtime.Register("getLong", "(Landroid/content/ContentResolver;Ljava/lang/String;)J", "")]
public static long GetLong (Android.Content.ContentResolver? cr, string? name);
[<Android.Runtime.Register("getLong", "(Landroid/content/ContentResolver;Ljava/lang/String;)J", "")>]
static member GetLong : Android.Content.ContentResolver * string -> int64
Parameters
The ContentResolver to access.
- name
- String
The name of the setting to retrieve.
Returns
The setting's current value.
- Attributes
Exceptions
Thrown if a setting by the given name can't be found or the setting value is not an integer.
Remarks
Convenience function for retrieving a single system settings value as a long
. Note that internally setting values are always stored as strings; this function converts the string to a long
for you.
This version does not take a default value. If the setting has not been set, or the string value is not a number, it throws SettingNotFoundException
.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
GetLong(ContentResolver, String, Int64)
Convenience function for retrieving a single system settings value
as a long
.
[Android.Runtime.Register("getLong", "(Landroid/content/ContentResolver;Ljava/lang/String;J)J", "")]
public static long GetLong (Android.Content.ContentResolver? cr, string? name, long def);
[<Android.Runtime.Register("getLong", "(Landroid/content/ContentResolver;Ljava/lang/String;J)J", "")>]
static member GetLong : Android.Content.ContentResolver * string * int64 -> int64
Parameters
The ContentResolver to access.
- name
- String
The name of the setting to retrieve.
- def
- Int64
Value to return if the setting is not defined.
Returns
The setting's current value, or 'def' if it is not defined
or not a valid long
.
- Attributes
Remarks
Convenience function for retrieving a single system settings value as a long
. Note that internally setting values are always stored as strings; this function converts the string to a long
for you. The default value will be returned if the setting is not defined or not a long
.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.