APISonar


com.meiji.toutiao.database.table.SearchHistoryTable.TIME

> com > meiji > toutiao > database > table > SearchHistoryTable > TIME
com APIs meiji APIs toutiao APIs database APIs table APIs SearchHistoryTable APIs TIME APIs

Example 1
public List<SearchHistoryBean> queryAll() {
        Cursor cursor = db.query(SearchHistoryTable.TABLENAME, null, null, null, null, null, SearchHistoryTable.TIME + " desc");
        List<SearchHistoryBean> list = new ArrayList<>();
        while (cursor.moveToNext()) {
            SearchHistoryBean bean = new SearchHistoryBean();
            bean.setKeyWord(cursor.getString(SearchHistoryTable.ID_KEYWORD));
            bean.setTime(cursor.getString(SearchHistoryTable.ID_TIME));
            list.add(bean);
        }
        cursor.close();
        return list;
    }
Example 2
public boolean add(String keyWord) {
        ContentValues values = new ContentValues();
        values.put(SearchHistoryTable.KEYWORD, keyWord);
        values.put(SearchHistoryTable.TIME, TimeUtil.getCurrentTimeStamp());
        long result = db.insert(SearchHistoryTable.TABLENAME, null, values);
        return result != -1;
    }