Java Code Examples for com.blankj.utilcode.util.LogUtils#e()
The following examples show how to use
com.blankj.utilcode.util.LogUtils#e() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AppInfoService.java From YCAudioPlayer with Apache License 2.0 | 6 votes |
@Override public List<AppInfo> getAppInfo(String sign) throws RemoteException { List<AppInfo> list=new ArrayList<>(); String aidlCheckAppInfoSign = AppToolUtils.getAidlCheckAppInfoSign(); LogUtils.e("AppInfoService--AppInfoService",aidlCheckAppInfoSign+"-------------"+sign); if(!aidlCheckAppInfoSign.equals(sign)){ return list; } list.add(new AppInfo("app版本号(versionName)", BuildConfig.VERSION_NAME)); list.add(new AppInfo("app版本名称(versionCode)", BuildConfig.VERSION_CODE+"")); list.add(new AppInfo("打包时间", BuildConfig.BUILD_TIME)); list.add(new AppInfo("app包名", getPackageName())); list.add(new AppInfo("app作者", SPUtils.getInstance(Constant.SP_NAME).getString("name","杨充"))); list.add(new AppInfo("app渠道", SPUtils.getInstance(Constant.SP_NAME).getString("channel"))); list.add(new AppInfo("token", SPUtils.getInstance(Constant.SP_NAME).getString("token"))); list.add(new AppInfo("App签名", AppToolUtils.getSingInfo(getApplicationContext(), getPackageName(), AppToolUtils.SHA1))); return list; }
Example 2
Source File: LoginParam.java From DanDanPlayForAndroid with MIT License | 6 votes |
public void buildHash(Context context) { if (StringUtils.isEmpty(userName) || StringUtils.isEmpty(password) || StringUtils.isEmpty(appId) || unixTimestamp == 0){ LogUtils.e("登录信息错误"); ToastUtils.showShort("登录信息错误"); }else { String builder = this.appId + this.password + this.unixTimestamp + this.userName + SoUtils.getInstance().getDanDanAppSecret(); hash = EncryptUtils.encryptMD5ToString(builder); } }
Example 3
Source File: PlayService.java From YCAudioPlayer with Apache License 2.0 | 5 votes |
/** * 下一首 * 记住有播放类型,单曲循环,顺序循环,随机播放 * 逻辑:如果不是最后一首,则还有下一首;如果是最后一首,则切换回第一首 */ public void next() { //建议都添加这个判断 if (audioMusics.isEmpty()) { return; } int playMode = SPUtils.getInstance(Constant.SP_NAME).getInt(Constant.PLAY_MODE, 0); int size = audioMusics.size(); PlayModeEnum mode = PlayModeEnum.valueOf(playMode); switch (mode) { //随机 case SHUFFLE: mPlayingPosition = new Random().nextInt(size); play(mPlayingPosition); break; //单曲 case SINGLE: play(mPlayingPosition); break; //顺序播放并且循环 case LOOP: default: if (mPlayingPosition != size - 1) { // 如果不是最后一首,则还有下一首 mPlayingPosition++; } else { // 如果是最后一首,则切换回第一首 mPlayingPosition = 0; } LogUtils.e("PlayService"+"----mPlayingPosition----"+ mPlayingPosition); play(mPlayingPosition); break; } }
Example 4
Source File: CommJsonObserver.java From DanDanPlayForAndroid with MIT License | 5 votes |
private String getErrorMessage(Throwable e) { LogUtils.e(e.toString()); if (e instanceof JsonSyntaxException) { LogUtils.i("error", e.toString()); return "数据异常"; } else if (e instanceof UnknownHostException) { LogUtils.i("error", e.toString()); return "网络连接中断"; } else if (e instanceof SocketTimeoutException) { return "服务器繁忙"; } return "服务器繁忙"; }
Example 5
Source File: RetrofitGetActivity.java From AndroidSamples with Apache License 2.0 | 5 votes |
/** * 设置TextView * * @param s */ private void setText(String s) { try { mRetrofit2Tv.setText(s); } catch (Exception e) { LogUtils.e("setText: ", e); } }
Example 6
Source File: EventBusStickyActivity.java From AndroidSamples with Apache License 2.0 | 5 votes |
@Subscribe(sticky = true, threadMode = ThreadMode.MAIN, priority = 100) public <T> void onMessageEvent(T t) { try { mTvEvent2Msg.setText(t.toString()); } catch (Exception e) { LogUtils.e("onMessageEvent: ", e); } }
Example 7
Source File: ScrollerView.java From AndroidSamples with Apache License 2.0 | 5 votes |
/** * 弹性滑动,只滑动内容,不改变位置(destX正左负右,destY正上负下) * @param destX * @param destY */ private void smoothScrollTo(int destX, int destY) { LogUtils.e("smoothScrollTo: "); // scrollX,scrollY对应原始位置左上角,水平与竖直方向 int scrollX = getScrollX(); int scrollY = getScrollY(); int delta = destX - scrollX; int deltb = destY - scrollY; // 1000ms内滑向destX scroller.startScroll(scrollX, scrollY, delta, deltb, 1000); // 调用computeScroll方法 invalidate(); }
Example 8
Source File: WebViewActivity.java From YCAudioPlayer with Apache License 2.0 | 5 votes |
@android.webkit.JavascriptInterface public void imageClick(String img) { Intent intent = new Intent(); intent.putExtra("url", img); //intent.setClass(context, ImgUrlActivity.class); context.startActivity(intent); LogUtils.e("WebViewActivity-----js接口返回数据-------图片---" + img); }
Example 9
Source File: CommJsonNoDataObserver.java From DanDanPlayForAndroid with MIT License | 5 votes |
private String getErrorMessage(Throwable e) { LogUtils.e(e.toString()); if (e instanceof JsonSyntaxException) { LogUtils.i("error", e.toString()); return "数据异常"; } else if (e instanceof UnknownHostException) { LogUtils.i("error", e.toString()); return "网络连接中断"; } else if (e instanceof SocketTimeoutException) { return "服务器繁忙"; } return "服务器繁忙"; }
Example 10
Source File: WebViewActivity.java From YCAudioPlayer with Apache License 2.0 | 5 votes |
@Override public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) { super.onReceivedError(view, request, error); LogUtils.e("WebViewActivity-----onReceivedError-------" + error.toString()); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { LogUtils.e("服务器异常" + error.getDescription().toString()); } ToastUtils.showRoundRectToast("服务器异常6.0之后"); //当加载错误时,就让它加载本地错误网页文件 //mWebView.loadUrl("file:///android_asset/errorpage/error.html"); showErrorPage();//显示错误页面 }
Example 11
Source File: CanvasView.java From AndroidSamples with Apache License 2.0 | 5 votes |
@Override public boolean onTouchEvent(MotionEvent event) { LogUtils.e("getX: " + event.getX()); LogUtils.e("getY: " + event.getY()); return true; }
Example 12
Source File: RetrofitActivity.java From AndroidSamples with Apache License 2.0 | 5 votes |
/** * 设置TextView * @param s 要设置的字符 */ private void setText(String s) { try { mRetrofit1Tv.setText(s); } catch (Exception e) { LogUtils.e("setText: ", e); } }
Example 13
Source File: MyIntentService.java From AndroidSamples with Apache License 2.0 | 4 votes |
/** * 需要注意构造方法 */ public MyIntentService() { super("name"); LogUtils.e("MyIntentService: "); }
Example 14
Source File: WebViewActivity.java From YCAudioPlayer with Apache License 2.0 | 4 votes |
@Override public void onReceivedLoginRequest(WebView view, String realm, String account, String args) { super.onReceivedLoginRequest(view, realm, account, args); LogUtils.e("WebViewActivity-----onReceivedLoginRequest-------"); }
Example 15
Source File: StageService.java From AndroidSamples with Apache License 2.0 | 4 votes |
@Nullable @Override public IBinder onBind(Intent intent) { LogUtils.e("onBind: "); return null; }
Example 16
Source File: NotInteractiveService.java From AndroidSamples with Apache License 2.0 | 4 votes |
@Override public void onCreate() { LogUtils.e( "onCreate: "); super.onCreate(); }
Example 17
Source File: NotInteractiveService.java From AndroidSamples with Apache License 2.0 | 4 votes |
@Override public void onDestroy() { mTimer.cancel(); LogUtils.e( "onDestroy: "); super.onDestroy(); }
Example 18
Source File: StageService.java From AndroidSamples with Apache License 2.0 | 4 votes |
@Override public void onCreate() { LogUtils.e("onCreate: "); showNotification(); super.onCreate(); }
Example 19
Source File: FriendsAdapter.java From Android-IM with Apache License 2.0 | 4 votes |
@Override protected void convert(BaseViewHolder helper, final T item) { final Button button = helper.getView(R.id.item_main_bt); final TextView time = helper.getView(R.id.item_main_time); final ImageView imageView = helper.getView(R.id.item_main_img); if (mMessageType != null) { switch (mMessageType) { case RECOMMEND: //推荐列表 // if (item.getFriends()) { // button.setText("已添加"); // button.setEnabled(false); // } else { // button.setText("添加"); // button.setEnabled(true); // } // button.setVisibility(View.VISIBLE); // button.setOnClickListener( // new View.OnClickListener() { // @Override // public void onClick(View view) { // Intent intent = new Intent(mContext, AddFriendMsgActivity.class); // intent.putExtra("ID", item.getContent()); // intent.putExtra("NAME", item.getTitle()); // mContext.startActivity(intent); // } // }); break; case FRIENDS: //好友列表 UserInfo data = (UserInfo) item; if (helper.getAdapterPosition() == 0) { LogUtils.e("nakeName:"+data.getNickname()+",userName:"+data.getUserName()+",id:"+data.getUserID()); } String name = ""; if (!data.getNickname().isEmpty()) { name = data.getNickname(); }else if (!data.getUserName().isEmpty()){ name = data.getUserName(); }else { name =""+data.getUserID(); } helper.setText(R.id.item_main_username, name) .setText(R.id.item_main_content, data.getSignature()) .setText(R.id.item_main_time, TimeUtils.unix2Date("MM-dd HH:mm", data.getmTime())); GlideUtil.loadUserHeadImg(mContext,data.getAvatar(),imageView); break; case CERT: // JMessageClient.getUserInfo(item.getUserName(), new GetUserInfoCallback() { // @Override // public void gotResult(int i, String s, UserInfo userInfo) { // if (i == 0) { // Log.e("isFriends", userInfo.getUserName() + "...." + userInfo.isFriend()); // if (userInfo.isFriend()) { // button.setText("已同意"); // button.setEnabled(false); // } else { // button.setText("同意"); // button.setEnabled(true); // } // button.setVisibility(View.VISIBLE); // } // } // }); // button.setOnClickListener( // new View.OnClickListener() { // @Override // public void onClick(View view) { // ContactManager.acceptInvitation(item.getUserName(), "", new BasicCallback() { // @Override // public void gotResult(int i, String s) { // if (i == 0) { // button.setText("已同意"); // } else { // ToastUtils.showShort("验证失败"); // } // } // }); // } // }); break; case MESSAGE: //会话列表 // if (Integer.valueOf(item.time) <= 0) { // time.setText(item.time + "条未读消息"); // time.setTextColor(Color.parseColor("#66000000")); // } else { // time.setText(item.time + "条未读消息"); // time.setTextColor(Color.parseColor("#E5955D")); // } break; default: break; } } }
Example 20
Source File: PlayMusicFragment.java From YCAudioPlayer with Apache License 2.0 | 2 votes |
/** * 使用FragmentPagerAdapter+ViewPager时, * 切换回上一个Fragment页面时(已经初始化完毕), * 不会回调任何生命周期方法以及onHiddenChanged(), * 只有setUserVisibleHint(boolean isVisibleToUser)会被回调, * 所以如果你想进行一些懒加载,需要在这里处理。 * @param isVisibleToUser 是否显示 */ @Override public void setUserVisibleHint(boolean isVisibleToUser) { super.setUserVisibleHint(isVisibleToUser); LogUtils.e(TAG+"setUserVisibleHint"+isVisibleToUser); }