首页 > 解决方案 > 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

标签: androidandroid-anr-dialog

解决方案


推荐阅读