android - ANR 警告:OnMeasure 时间太长
问题描述
当我运行应用程序时,内容需要时间加载到活动中,我使用 Volley 进行异步请求,所以这不是问题。问题是在渲染时。
D/View: [ANR Warning]onMeasure time too long, this =android.widget.RelativeLayout{44d79d5 V.E...... ......I. 0,0-1080,1500}time =406 ms
[ANR Warning]onMeasure time too long, this =android.support.v4.widget.NestedScrollView{fd9f5ea VFED..... ......I. 0,0-1080,1500}time =406 ms
D/skia: SkJpegCodec::onGetPixels -
D/View: [ANR Warning]onMeasure time too long, this =android.widget.RelativeLayout{be528f6 V.E...... ......I. 0,180-1080,1848 #7f090110 app:id/rl}time =425 ms
I/art: Do partial code cache collection, code=228KB, data=227KB
D/View: [ANR Warning]onMeasure time too long, this =android.support.design.widget.CoordinatorLayout{5b730db V.E...... ......ID 0,72-1080,1920}time =429 ms
I/art: After code cache collection, code=216KB, data=214KB
Increasing code cache capacity to 1024KB
D/View: [ANR Warning]onMeasure time too long, this =android.support.v4.widget.DrawerLayout{444b778 VFED..... ......ID 0,0-1080,1920 #7f090076 app:id/drawer_layout}time =430 ms
D/View: [ANR Warning]onMeasure time too long, this =android.support.v7.widget.ContentFrameLayout{ff8de51 V.E...... ......ID 0,0-1080,1920 #1020002 android:id/content}time =430 ms
[ANR Warning]onMeasure time too long, this =android.support.v7.widget.FitWindowsLinearLayout{45986b6 V.E...... ......ID 0,0-1080,1920 #7f09001d app:id/action_bar_root}time =431 ms
[ANR Warning]onMeasure time too long, this =android.widget.FrameLayout{7edffb7 V.E...... ......ID 0,0-1080,1920}time =431 ms
D/View: [ANR Warning]onMeasure time too long, this =android.widget.LinearLayout{2c9d324 V.E...... ......ID 0,0-1080,1920}time =432 ms
[ANR Warning]onMeasure time too long, this =DecorView@d524ced[Dashboard]time =432 ms
解决方案
推荐阅读
- excel - 使用 RC[-1] 单元格的相关数据验证公式
- android - 如何在本机反应中添加firebase电话号码身份验证?
- java - 找到没有连续 1 的最小二进制数
- android - 为什么 kotlin 协程会阻塞这段代码?
- javascript - 用 Javascript 构建井字游戏 - 单击特定字段时删除事件
- javascript - 如何在嵌入中提及刚刚进入我的服务器的成员?
- python - 如何在pygame中删除一个矩形?
- java - 在 DesktopApplication 上使用 RestTemplate(非基于 Web)
- r - VBA文件路径连接问题
- javascript - 如何通过比较第一页 url 和第二页来检测 url 变化