当前位置: 首页>>代码示例>>Java>>正文


Java Config类代码示例

本文整理汇总了Java中android.util.Config的典型用法代码示例。如果您正苦于以下问题:Java Config类的具体用法?Java Config怎么用?Java Config使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Config类属于android.util包,在下文中一共展示了Config类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onClick

import android.util.Config; //导入依赖的package包/类
@Override
public final void onClick(View v) {
    final long lastClickTime = mLastClickTime;
    final long now = SystemClock.uptimeMillis(); //guaranteed 100% monotonic

    if (now - lastClickTime < MIN_DELAY_MS && !override) {
        // Too fast: ignore
        if (Config.LOGD) {
            Log.d(TAG, "onClick Clicked too quickly: ignored");
        }
    } else {
        override = false;
        // Update mLastClickTime and register the click
        mLastClickTime = now;
        onSingleClick(v);
    }
}
 
开发者ID:ccrama,项目名称:Slide-RSS,代码行数:18,代码来源:OnSingleClickListener.java

示例2: validateSelection

import android.util.Config; //导入依赖的package包/类
/**
    * Checks whether this looks like a legitimate selection parameter
    */
   public static void validateSelection(String selection,
    Set<String> allowedColumns) {
try {
    if (selection == null || selection.length() == 0) {
	return;
    }
    Lexer lexer = new Lexer(selection, allowedColumns);
    parseExpression(lexer);
    if (lexer.currentToken() != Lexer.TOKEN_END) {
	throw new IllegalArgumentException("syntax error");
    }
} catch (RuntimeException ex) {
    if (Constants.LOGV) {
	Log.d(Constants.TAG, "invalid selection [" + selection
		+ "] triggered " + ex);
    } else if (Config.LOGD) {
	Log.d(Constants.TAG, "invalid selection triggered " + ex);
    }
    throw ex;
}

   }
 
开发者ID:hubcarl,项目名称:mobile-manager-tool,代码行数:26,代码来源:Helpers.java

示例3: getColumnIndex

import android.util.Config; //导入依赖的package包/类
public int getColumnIndex(String columnName) {
    // Hack according to bug 903852
    final int periodIndex = columnName.lastIndexOf('.');
    if (periodIndex != -1) {
        Exception e = new Exception();
        Log.e(TAG, "requesting column name with table name -- " + columnName, e);
        columnName = columnName.substring(periodIndex + 1);
    }

    String columnNames[] = getColumnNames();
    int length = columnNames.length;
    for (int i = 0; i < length; i++) {
        if (columnNames[i].equalsIgnoreCase(columnName)) {
            return i;
        }
    }

    if (Config.LOGV) {
        if (getCount() > 0) {
            Log.w("AbstractCursor", "Unknown column " + columnName);
        }
    }
    return -1;
}
 
开发者ID:itsmechlark,项目名称:greendao-cipher,代码行数:25,代码来源:AbstractCursor.java

示例4: finalize

import android.util.Config; //导入依赖的package包/类
/**
 * Release the native resources, if they haven't been released yet.
 */
@Override
protected void finalize() {
    try {
        // if the cursor hasn't been closed yet, close it first
        if (mWindow != null) {
            int len = mQuery.mSql.length();
            Log.e(TAG, "Finalizing a Cursor that has not been deactivated or closed. " +
                    "database = " + mDatabase.getPath() + ", table = " + mEditTable +
                    ", query = " + mQuery.mSql.substring(0, (len > 100) ? 100 : len),
                    mStackTrace);
            close();
            SQLiteDebug.notifyActiveCursorFinalized();
        } else {
            if (Config.LOGV) {
                Log.v(TAG, "Finalizing cursor on database = " + mDatabase.getPath() +
                        ", table = " + mEditTable + ", query = " + mQuery.mSql);
            }
        }
    } finally {
        super.finalize();
    }
}
 
开发者ID:itsmechlark,项目名称:greendao-cipher,代码行数:26,代码来源:SQLiteCursor.java

示例5: validateSelection

import android.util.Config; //导入依赖的package包/类
/**
 * Checks whether this looks like a legitimate selection parameter
 */
public static void validateSelection(String selection, Set<String> allowedColumns) {
    try {
        if (selection == null || selection.contentEquals("")) {
            return;
        }
        Lexer lexer = new Lexer(selection, allowedColumns);
        parseExpression(lexer);
        if (lexer.currentToken() != Lexer.TOKEN_END) {
            throw new IllegalArgumentException("syntax error");
        }
    } catch (RuntimeException ex) {
        if (Constants.LOGV) {
            Log.d(Constants.TAG, "invalid selection [" + selection + "] triggered " + ex);
        } else if (Config.LOGD) {
            Log.d(Constants.TAG, "invalid selection triggered " + ex);
        }
        throw ex;
    }

}
 
开发者ID:msafin,项目名称:wmc,代码行数:24,代码来源:Helpers.java

示例6: DBHelper

import android.util.Config; //导入依赖的package包/类
private DBHelper(Context context) {
    DaoMaster.DevOpenHelper helper = new DaoMaster.DevOpenHelper(context, DB_NAME, null);
    db = helper.getWritableDatabase();
    // 注意:该数据库连接属于 DaoMaster,所以多个 Session 指的是相同的数据库连接。
    DaoMaster daoMaster = new DaoMaster(db);
    daoSession = daoMaster.newSession();
    if(Config.DEBUG) {
        QueryBuilder.LOG_SQL = true;
        QueryBuilder.LOG_VALUES = true;
    }
}
 
开发者ID:SilenceDut,项目名称:NBAPlus,代码行数:12,代码来源:DBHelper.java

示例7: binderDied

import android.util.Config; //导入依赖的package包/类
public void binderDied()
{
    if (Config.LOGD) Log.d( TAG, "OpenVpnStateListener died" );

    synchronized (mListeners)
    {
        mListeners.remove( this );
    }
    if (mListener != null)
    {
        mListener.asBinder().unlinkToDeath( this, 0 );
    }
}
 
开发者ID:serega1983,项目名称:android-openvpn-settings,代码行数:14,代码来源:OpenVpnStateListenerDispatcher.java

示例8: onContentChangedInternal

import android.util.Config; //导入依赖的package包/类
/**
 * Called when the {@link ContentObserver} on the cursor receives a change notification.
 * The default implementation provides the auto-requery logic, but may be overridden by
 * sub classes.
 *
 * @see ContentObserver#onChange(boolean)
 */
// renamed from Android source so as not to conflict with RobolectricWiringTest
protected void onContentChangedInternal() {
  if (mAutoRequery && mCursor != null && !mCursor.isClosed()) {
    if (Config.LOGV) Log.v("Cursor", "Auto requerying " + mCursor + " due to update");
    mDataValid = mCursor.requery();
  }
}
 
开发者ID:qx,项目名称:FullRobolectricTestSample,代码行数:15,代码来源:ShadowCursorAdapter.java

示例9: SQLiteCursor

import android.util.Config; //导入依赖的package包/类
/**
 * Execute a query and provide access to its result set through a Cursor
 * interface. For a query such as: {@code SELECT name, birth, phone FROM
 * myTable WHERE ... LIMIT 1,20 ORDER BY...} the column names (name, birth,
 * phone) would be in the projection argument and everything from
 * {@code FROM} onward would be in the params argument. This constructor
 * has package scope.
 *
 * @param db a reference to a Database object that is already constructed
 *     and opened
 * @param editTable the name of the table used for this query
 * @param query the rest of the query terms
 *     cursor is finalized
 */
public SQLiteCursor(SQLiteDatabase db, SQLiteCursorDriver driver,
        String editTable, SQLiteQuery query) {
    // The AbstractCursor constructor needs to do some setup.
    super();
    mStackTrace = new DatabaseObjectNotClosedException().fillInStackTrace();
    mDatabase = db;
    mDriver = driver;
    mEditTable = editTable;
    mColumnNameMap = null;
    mQuery = query;

    try {
        db.lock();

        // Setup the list of columns
        int columnCount = mQuery.columnCountLocked();
        mColumns = new String[columnCount];

        // Read in all column names
        for (int i = 0; i < columnCount; i++) {
            String columnName = mQuery.columnNameLocked(i);
            mColumns[i] = columnName;
            if (Config.LOGV) {
                Log.v("DatabaseWindow", "mColumns[" + i + "] is "
                        + mColumns[i]);
            }

            // Make note of the row ID column index for quick access to it
            if ("_id".equals(columnName)) {
                mRowIdColumnIndex = i;
            }
        }
    } finally {
        db.unlock();
    }
}
 
开发者ID:itsmechlark,项目名称:greendao-cipher,代码行数:51,代码来源:SQLiteCursor.java

示例10: deactivateCommon

import android.util.Config; //导入依赖的package包/类
private void deactivateCommon() {
    if (Config.LOGV) Log.v(TAG, "<<< Releasing cursor " + this);
    mCursorState = 0;
    if (mWindow != null) {
        mWindow.close();
        mWindow = null;
    }
    if (Config.LOGV) Log.v("DatabaseWindow", "closing window in release()");
}
 
开发者ID:itsmechlark,项目名称:greendao-cipher,代码行数:10,代码来源:SQLiteCursor.java

示例11: v

import android.util.Config; //导入依赖的package包/类
public static void v(String TAG, String logMe) {
    if (Config.LOGV) android.util.Log.v(LOGTAG, TAG + ": " + logMe);
}
 
开发者ID:leinardi,项目名称:KitchenTimer,代码行数:4,代码来源:Log.java

示例12: d

import android.util.Config; //导入依赖的package包/类
public static void d(String TAG, String logMe) {
    if (Config.LOGD) android.util.Log.d(LOGTAG, TAG + ": " + logMe);
}
 
开发者ID:leinardi,项目名称:KitchenTimer,代码行数:4,代码来源:Log.java

示例13: i

import android.util.Config; //导入依赖的package包/类
public static void i(String TAG, String logMe) {
    if (Config.LOGD) android.util.Log.i(LOGTAG, TAG + ": " + logMe);
}
 
开发者ID:leinardi,项目名称:KitchenTimer,代码行数:4,代码来源:Log.java

示例14: createSmilDocument

import android.util.Config; //导入依赖的package包/类
private static SMILDocument createSmilDocument(PduBody pb) {
    if (Config.LOGV) {
        Log.v(TAG, "Creating default SMIL document.");
    }

    SMILDocument document = new SmilDocumentImpl();

    // Create root element.
    // FIXME: Should we create root element in the constructor of document?
    SMILElement smil = (SMILElement) document.createElement("smil");
    smil.setAttribute("xmlns", "http://www.w3.org/2001/SMIL20/Language");
    document.appendChild(smil);

    // Create <head> and <layout> element.
    SMILElement head = (SMILElement) document.createElement("head");
    smil.appendChild(head);

    SMILLayoutElement layout = (SMILLayoutElement) document.createElement("layout");
    head.appendChild(layout);

    // Create <body> element and add a empty <par>.
    SMILElement body = (SMILElement) document.createElement("body");
    smil.appendChild(body);
    SMILParElement par = addPar(document);

    // Create media objects for the parts in PDU.
    int partsNum = pb.getPartsNum();
    if (partsNum == 0) {
        return document;
    }

    DrmManagerClient drmManagerClient = QKSMSApp.getApplication().getDrmManagerClient();

    boolean hasText = false;
    boolean hasMedia = false;
    for (int i = 0; i < partsNum; i++) {
        // Create new <par> element.
        if ((par == null) || (hasMedia && hasText)) {
            par = addPar(document);
            hasText = false;
            hasMedia = false;
        }

        PduPart part = pb.getPart(i);
        String contentType = new String(part.getContentType());

        if (ContentType.isDrmType(contentType)) {
            contentType = drmManagerClient.getOriginalMimeType(part.getDataUri());
        }

        if (contentType.equals(ContentType.TEXT_PLAIN)
                || contentType.equalsIgnoreCase(ContentType.APP_WAP_XHTML)
                || contentType.equals(ContentType.TEXT_HTML)) {
            SMILMediaElement textElement = createMediaElement(
                    ELEMENT_TAG_TEXT, document, part.generateLocation());
            par.appendChild(textElement);
            hasText = true;
        } else if (ContentType.isImageType(contentType)) {
            SMILMediaElement imageElement = createMediaElement(
                    ELEMENT_TAG_IMAGE, document, part.generateLocation());
            par.appendChild(imageElement);
            hasMedia = true;
        } else if (ContentType.isVideoType(contentType)) {
            SMILMediaElement videoElement = createMediaElement(
                    ELEMENT_TAG_VIDEO, document, part.generateLocation());
            par.appendChild(videoElement);
            hasMedia = true;
        } else if (ContentType.isAudioType(contentType)) {
            SMILMediaElement audioElement = createMediaElement(
                    ELEMENT_TAG_AUDIO, document, part.generateLocation());
            par.appendChild(audioElement);
            hasMedia = true;
        } else {
            // TODO: handle other media types.
            Log.w(TAG, "unsupport media type");
        }
    }

    return document;
}
 
开发者ID:moezbhatti,项目名称:qksms,代码行数:81,代码来源:SmilHelper.java

示例15: getCallerInfo

import android.util.Config; //导入依赖的package包/类
/**
 * getCallerInfo given a Cursor.
 * @param context the context used to retrieve string constants
 * @param contactRef the URI to attach to this CallerInfo object
 * @param cursor the first object in the cursor is used to build the CallerInfo object.
 * @return the CallerInfo which contains the caller id for the given
 * number. The returned CallerInfo is null if no number is supplied.
 */
public static CallerInfo getCallerInfo(Context context, Uri contactRef, Cursor cursor) {
    
    CallerInfo info = new CallerInfo();
    info.photoResource = 0;
    info.phoneLabel = null;
    info.numberType = 0;
    info.numberLabel = null;
    info.cachedPhoto = null;
    info.isCachedPhotoCurrent = false;
    
    if (Config.LOGV) Log.v(TAG, "construct callerInfo from cursor");
    
    if (cursor != null) {
        while (cursor.moveToNext()) {

            int columnIndex;

            // Look for the number
            columnIndex = cursor.getColumnIndex(ContactsContract.PhoneLookup.NUMBER);
            if (columnIndex != -1) {
                info.phoneNumber = cursor.getString(columnIndex);
            }
            
            // Look for the name
            columnIndex = cursor.getColumnIndex(ContactsContract.PhoneLookup.DISPLAY_NAME);
            if (columnIndex != -1) {
                info.name = cursor.getString(columnIndex);
            }

            // Look for the label/type combo
            columnIndex = cursor.getColumnIndex(ContactsContract.PhoneLookup.LABEL);
            if (columnIndex != -1) {
                int typeColumnIndex = cursor.getColumnIndex(ContactsContract.PhoneLookup.TYPE);
                if (typeColumnIndex != -1) {
                    info.numberType = cursor.getInt(typeColumnIndex);
                    info.numberLabel = cursor.getString(columnIndex);
                    info.phoneLabel = ContactsContract.CommonDataKinds.Phone.getTypeLabel(context.getResources(),
                            info.numberType, info.numberLabel)
                            .toString();
                }
            }

            // Look for the person ID
            columnIndex = cursor.getColumnIndex(Phone.CONTACT_ID);
            if (columnIndex != -1) {
                    info.person_id = cursor.getLong(columnIndex);
            }
        }
        cursor.close();
    }

    info.needUpdate = false;
    info.name = normalize(info.name);
    info.contactRefUri = contactRef;

    return info;
}
 
开发者ID:mnhkahn,项目名称:cInterphone,代码行数:66,代码来源:CallerInfo.java


注:本文中的android.util.Config类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。