本文整理汇总了Java中com.socks.library.KLog.e方法的典型用法代码示例。如果您正苦于以下问题:Java KLog.e方法的具体用法?Java KLog.e怎么用?Java KLog.e使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.socks.library.KLog
的用法示例。
在下文中一共展示了KLog.e方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreateViewHolder
import com.socks.library.KLog; //导入方法依赖的package包/类
@Override
public ViewHolder onCreateViewHolder(ViewGroup viewGroup, int index) {
if (index > -1) {
//getting the ViewHolder class for a given item position
Class viewHolderClass = this.viewHolders.get(index);
View view = LayoutInflater.
from(viewGroup.getContext()).
inflate(fragmentResources.get(viewHolderClass), viewGroup, false);
//getting the constuctor of the ViewHolder by instropection
try {
Constructor constructor =
viewHolderClass.getConstructor(View.class);
return (ViewHolder) constructor.newInstance(view);
} catch (Exception e) {
KLog.e("exception while creating viewHolder : " + e.getLocalizedMessage(), e);
}
}
return null;
}
示例2: decrypt
import com.socks.library.KLog; //导入方法依赖的package包/类
@Deprecated
private static String decrypt(String ciphertext) {
if (ciphertext == null || ciphertext.length() == 0) {
return ciphertext;
}
try {
final Cipher cipher = Cipher.getInstance(AES_KEY_ALG, PROVIDER);
cipher.init(Cipher.DECRYPT_MODE, new SecretKeySpec(
SecurePreferences.sKey, AES_KEY_ALG));
return new String(cipher.doFinal(SecurePreferences
.decode(ciphertext)), "UTF-8");
} catch (Exception e) {
if (sLoggingEnabled) {
KLog.e(TAG, "decrypt:::" + e);
}
return null;
}
}
示例3: getDataSuccess
import com.socks.library.KLog; //导入方法依赖的package包/类
@Override
public void getDataSuccess(CookBookListModel model) {
KLog.e(new Gson().toJson(model));
if (model.getTngou()!=null){
if (isFirst){
isFirst=false;
mData=model;
mAdapter=new CookBookListAdapter(context,mData);
mXRecyclerView.setAdapter(mAdapter);
mAdapter.setOnItemClickLitener(new ItemClickListener());
}else {
if (page==1){
mData.getTngou().clear();
mData=model;
mAdapter.setData(mData);
mXRecyclerView.refreshComplete();
}else {
mData.getTngou().addAll(model.getTngou());
mAdapter.setData(mData);
mXRecyclerView.loadMoreComplete();
}
}
}
}
示例4: getCountByWhere
import com.socks.library.KLog; //导入方法依赖的package包/类
/**
* 根据条件查询记录条数
*
* @param selection 条件
* @param selectionArgs 值
* @return
*/
public long getCountByWhere(String selection,String[] selectionArgs){
db.beginTransaction();
long count = 0;
Cursor cursor = null;
try {
cursor = db.rawQuery("select count(news_channel_id) from " + DBHelper.TABLE_NEWS_CHANNEL + " where " + selection,selectionArgs);
cursor.moveToFirst();
count = cursor.getLong(0);
db.setTransactionSuccessful();
}catch (Exception e){
KLog.e(e.getMessage());
}finally {
if(cursor != null) cursor.close();
db.endTransaction();
}
return count;
}
示例5: openFile
import com.socks.library.KLog; //导入方法依赖的package包/类
/**
* 调用系统打开文件
*/
public static boolean openFile(File file, Context context) {
Intent intent = new Intent();
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
// 设置intent的Action属性
intent.setAction(Intent.ACTION_VIEW);
// 获取文件file的MIME类型
String type = getMIMEType(file);
// 设置intent的data和Type属性。
intent.setDataAndType(Uri.fromFile(file), type);
// 跳转
try {
((Activity) context).startActivity(intent);
} catch (ActivityNotFoundException e) {
KLog.e(e);
return false;
}
return true;
}
示例6: copyFile
import com.socks.library.KLog; //导入方法依赖的package包/类
/**
* 复制单个文件
*
* @param oldPath String 原文件路径
* @param newPath String 复制后路径
* @return boolean
*/
public static boolean copyFile(String oldPath, String newPath) {
try {
int byteread = 0;
File oldfile = new File(oldPath);
if (oldfile.exists()) { // 文件存在时
InputStream inStream = new FileInputStream(oldPath); // 读入原文件
FileOutputStream fs = new FileOutputStream(newPath);
byte[] buffer = new byte[IO_BUFFER_SIZE];
while ((byteread = inStream.read(buffer)) != -1) {
fs.write(buffer, 0, byteread);
}
inStream.close();
fs.close();
}
} catch (Exception e) {
KLog.e(e);
return false;
}
return true;
}
示例7: writeToFile
import com.socks.library.KLog; //导入方法依赖的package包/类
/**
* 写入文件
*
* @param strFileName 文件名
* @param ins 流
*/
public static void writeToFile(String strFileName, InputStream ins) {
try {
File file = new File(strFileName);
FileOutputStream fouts = new FileOutputStream(file);
int len;
int maxSize = 1024 * 1024;
byte buf[] = new byte[maxSize];
while ((len = ins.read(buf, 0, maxSize)) != -1) {
fouts.write(buf, 0, len);
fouts.flush();
}
fouts.close();
} catch (IOException e) {
KLog.e(e);
}
}
示例8: setDotViewNum
import com.socks.library.KLog; //导入方法依赖的package包/类
/**
* 当前需要展示的dotview数量
*/
public void setDotViewNum(int num) {
if (num > MAX_DOT_NUM || num <= 0) {
KLog.e(TAG, "num必须在1~" + MAX_DOT_NUM + "之间哦");
return;
}
if (num <= 1) {
removeAllViews();
setVisibility(GONE);
}
if (this.mDotsNum != num) {
this.mDotsNum = num;
removeAllViews();
mDotViews.clear();
mDotViews = null;
buildDotView(getContext());
setCurrentSelection(currentSelection);
}
}
示例9: setLeftIcon
import com.socks.library.KLog; //导入方法依赖的package包/类
public void setLeftIcon(@DrawableRes int resId) {
try {
iv_left.setImageResource(resId);
setShowLeftIcon(resId != 0);
} catch (Exception e) {
KLog.e(e);
}
}
示例10: setRightIcon
import com.socks.library.KLog; //导入方法依赖的package包/类
public void setRightIcon(@DrawableRes int resId) {
try {
iv_right.setImageResource(resId);
setShowRightIcon(resId != 0);
} catch (Exception e) {
KLog.e(e);
}
}
示例11: setRightIcon
import com.socks.library.KLog; //导入方法依赖的package包/类
public void setRightIcon(int resid) {
try {
iv_right.setImageResource(resid);
setShowRightIcon(resid != 0);
} catch (Exception e) {
KLog.e(e);
}
}
示例12: SecurePreferences
import com.socks.library.KLog; //导入方法依赖的package包/类
/**
* Constructor.
*
* @param context the caller's context
*/
public SecurePreferences(Context context) {
// Proxy design pattern
if (SecurePreferences.sFile == null) {
SecurePreferences.sFile = PreferenceManager
.getDefaultSharedPreferences(context);
}
// Initialize encryption/decryption key
try {
final String key = SecurePreferences.generateAesKeyName(context);
String value = SecurePreferences.sFile.getString(key, null);
if (value == null) {
value = SecurePreferences.generateAesKeyValue();
SecurePreferences.sFile.edit().putString(key, value).commit();
}
SecurePreferences.sKey = SecurePreferences.decode(value);
} catch (Exception e) {
if (sLoggingEnabled) {
KLog.e("Error init:" + e.getMessage());
}
throw new IllegalStateException(e);
}
// initialize OnSecurePreferencesChangeListener HashMap
sOnSharedPreferenceChangeListeners = new HashMap<OnSharedPreferenceChangeListener, OnSharedPreferenceChangeListener>(
10);
}
示例13: cancelImageGetterSubscription
import com.socks.library.KLog; //导入方法依赖的package包/类
/**
* 解绑ImageGetterSubscription
*/
public void cancelImageGetterSubscription(){
if(imgGetter != null){
try {
imgGetter.unSubscribe();
}catch (Exception e){
KLog.e("解绑 UrlImageGetter Subscription 异常");
}
}
}
示例14: registerOnSharedPreferenceChangeListener
import com.socks.library.KLog; //导入方法依赖的package包/类
/**
* @param listener OnSharedPreferenceChangeListener
* @param decryptKeys Callbacks receive the "key" parameter decrypted
*/
public void registerOnSharedPreferenceChangeListener(
final OnSharedPreferenceChangeListener listener, boolean decryptKeys) {
if (!decryptKeys) {
registerOnSharedPreferenceChangeListener(listener);
return;
}
// wrap user's OnSharedPreferenceChangeListener with another that
// decrypts key before
// calling the onSharedPreferenceChanged callback
OnSharedPreferenceChangeListener secureListener = new OnSharedPreferenceChangeListener() {
private OnSharedPreferenceChangeListener mInsecureListener = listener;
@Override
public void onSharedPreferenceChanged(
SharedPreferences sharedPreferences, String key) {
try {
String decryptedKey = decrypt(key);
if (decryptedKey != null) {
mInsecureListener.onSharedPreferenceChanged(
sharedPreferences, decryptedKey);
}
} catch (Exception e) {
KLog.e(TAG, "Unable to decrypt key: " + key);
}
}
};
sOnSharedPreferenceChangeListeners.put(listener, secureListener);
SecurePreferences.sFile
.registerOnSharedPreferenceChangeListener(secureListener);
}
示例15: loadNewsChannels
import com.socks.library.KLog; //导入方法依赖的package包/类
public List<NewsChannelTable> loadNewsChannels(String isSelect){
List<NewsChannelTable> list = new ArrayList<>();
db.beginTransaction();
Cursor cursor = null;
try{
cursor = db.query(DBHelper.TABLE_NEWS_CHANNEL,null,"news_channel_select = ? ",new String[]{isSelect},null,null,"news_channel_index asc");
if(cursor.moveToFirst()) {
while (!cursor.isAfterLast()) {
String channelName = cursor.getString(cursor.getColumnIndex("news_channel_name"));
String channelId = cursor.getString(cursor.getColumnIndex("news_channel_id"));
String channelType = cursor.getString(cursor.getColumnIndex("news_channel_type"));
boolean channelSelect = cursor.getInt(cursor.getColumnIndex("news_channel_select")) == 1;
int channelIndex = cursor.getInt(cursor.getColumnIndex("news_channel_index"));
boolean channelFixed = cursor.getInt(cursor.getColumnIndex("news_channel_fixed")) == 1;
NewsChannelTable channelTable = new NewsChannelTable(channelName,channelId,channelType,channelSelect,channelIndex,channelFixed);
KLog.d("FIND--","loadNewsChannels--"+channelTable.toString());
list.add(channelTable);
cursor.moveToNext();
}
}
db.setTransactionSuccessful();
}catch (Exception e){
/**
* exception log
*/
KLog.e(e.getMessage());
}finally {
if(cursor != null){
cursor.close();
}
db.endTransaction();
}
return list;
}