本文整理汇总了Java中android.content.ContentValues.getAsBoolean方法的典型用法代码示例。如果您正苦于以下问题:Java ContentValues.getAsBoolean方法的具体用法?Java ContentValues.getAsBoolean怎么用?Java ContentValues.getAsBoolean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.content.ContentValues
的用法示例。
在下文中一共展示了ContentValues.getAsBoolean方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addBookmark
import android.content.ContentValues; //导入方法依赖的package包/类
private long addBookmark(ContentValues values) {
String url = values.getAsString(BookmarkColumns.URL);
String title = values.getAsString(BookmarkColumns.TITLE);
boolean isFolder = false;
if (values.containsKey(BOOKMARK_IS_FOLDER_PARAM)) {
isFolder = values.getAsBoolean(BOOKMARK_IS_FOLDER_PARAM);
}
long parentId = INVALID_BOOKMARK_ID;
if (values.containsKey(BOOKMARK_PARENT_ID_PARAM)) {
parentId = values.getAsLong(BOOKMARK_PARENT_ID_PARAM);
}
long id = nativeAddBookmark(mNativeChromeBrowserProvider, url, title, isFolder, parentId);
if (id == INVALID_BOOKMARK_ID) return id;
if (isFolder) {
updateLastModifiedBookmarkFolder(id);
} else {
updateLastModifiedBookmarkFolder(parentId);
}
return id;
}
示例2: copyBoolean
import android.content.ContentValues; //导入方法依赖的package包/类
private static final void copyBoolean(String key, ContentValues from, ContentValues to) {
Boolean b = from.getAsBoolean(key);
if (b != null) {
to.put(key, b);
}
}
示例3: createFromContentValue
import android.content.ContentValues; //导入方法依赖的package包/类
public final void createFromContentValue(ContentValues args) {
Integer tmp_i;
String tmp_s;
Long tmp_l;
Boolean tmp_b;
tmp_s = args.getAsString(FIELD_FROM);
if(tmp_s != null) {
from = tmp_s;
}
tmp_s = args.getAsString(FIELD_TO);
if(tmp_s != null) {
to = tmp_s;
}
tmp_s = args.getAsString(FIELD_CONTACT);
if(tmp_s != null) {
contact = tmp_s;
}
tmp_s = args.getAsString(FIELD_BODY);
if(tmp_s != null) {
body = tmp_s;
}
tmp_s = args.getAsString(FIELD_MIME_TYPE);
if(tmp_s != null) {
mimeType = tmp_s;
}
tmp_l = args.getAsLong(FIELD_DATE);
if(tmp_l != null) {
date = tmp_l;
}
tmp_i = args.getAsInteger(FIELD_TYPE);
if(tmp_i != null) {
type = tmp_i;
}
tmp_i = args.getAsInteger(FIELD_STATUS);
if(tmp_i != null) {
status = tmp_i;
}
tmp_b = args.getAsBoolean(FIELD_READ);
if(tmp_b != null) {
read = tmp_b;
}
tmp_s = args.getAsString(FIELD_FROM_FULL);
if(tmp_s != null) {
fullFrom = tmp_s;
}
}
示例4: createFromContentValue
import android.content.ContentValues; //导入方法依赖的package包/类
/**
* Fill account state object from content values.
* @param args content values to wrap.
*/
public final void createFromContentValue(ContentValues args) {
Integer tmp_i;
String tmp_s;
Boolean tmp_b;
tmp_i = args.getAsInteger(ACCOUNT_ID);
if(tmp_i != null) {
databaseId = tmp_i;
}
tmp_i = args.getAsInteger(PJSUA_ID);
if(tmp_i != null) {
pjsuaId = tmp_i;
}
tmp_s = args.getAsString(WIZARD);
if(tmp_s != null) {
wizard = tmp_s;
}
tmp_b = args.getAsBoolean(ACTIVE);
if(tmp_b != null) {
active = tmp_b;
}
tmp_i = args.getAsInteger(STATUS_CODE);
if(tmp_i != null) {
statusCode = tmp_i;
}
tmp_s = args.getAsString(STATUS_TEXT);
if(tmp_s != null) {
statusText = tmp_s;
}
tmp_i = args.getAsInteger(ADDED_STATUS);
if(tmp_i != null) {
addedStatus = tmp_i;
}
tmp_i = args.getAsInteger(EXPIRES);
if(tmp_i != null) {
expires = tmp_i;
}
tmp_s = args.getAsString(DISPLAY_NAME);
if(tmp_s != null) {
displayName = tmp_s;
}
tmp_s = args.getAsString(REG_URI);
if(tmp_s != null) {
regUri = tmp_s;
}
tmp_i = args.getAsInteger(PRIORITY);
if(tmp_i != null) {
priority = tmp_i;
}
}
示例5: isEnabled
import android.content.ContentValues; //导入方法依赖的package包/类
private boolean isEnabled(ContentValues values, boolean def) {
return values == null || !values.containsKey(VALUE) ? def : values.getAsBoolean(VALUE);
}