frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java

/** * Computes the bounds to fit the Activity within the bounds of the {@link Configuration}. */// TODO(b/36505427): Consider moving this method and similar ones to ConfigurationContainer.private void computeBounds(Rect outBounds)

能正常显示的activity信息:
0417 01-01 17:27:31.716: I/ActivityManager(10568): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10000100 cmp=com.android.launcher3/.Launcher} from pid 0 uid 0
0437 01-01 17:27:31.786: D/ActivityManager(10568): [computeBounds] info = ActivityInfo{bd4978b com.android.launcher3.Launcher}
0438 01-01 17:27:31.786: D/ActivityManager(10568): [computeBounds] task inMultiWindowMode ? false
0439 01-01 17:27:31.787: D/ActivityManager(10568): [computeBounds] maxAspectRatio === 0.0
0440 01-01 17:27:31.787: D/ActivityManager(10568): [computeBounds] getConfiguration() == {1.0 ?mcc?mnc [zh_CN] ldltr sw426dp w1925dp h402dp 120dpi nrml long hdr land finger -keyb/v/h -nav/h winConfig={ mBounds=Rect(0, 0 - 1444, 320) mAppBounds=Rect(0, 0 - 1444, 320) mWindowingMode=fullscreen mActivityType=home} s.4}
0441 01-01 17:27:31.787: D/ActivityManager(10568): [computeBounds] isInVrUiMode(getConfiguration()) == false
0442 01-01 17:27:31.787: D/ActivityManager(10568): [computeBounds] maxAspectRatio = 0.0
0443 01-01 17:27:31.787: D/ActivityManager(10568): [computeBounds] task.inMultiWindowMode() = false
0444 01-01 17:27:31.787: D/ActivityManager(10568): [computeBounds] getConfiguration() = {1.0 ?mcc?mnc [zh_CN] ldltr sw426dp w1925dp h402dp 120dpi nrml long hdr land finger -keyb/v/h -nav/h winConfig={ mBounds=Rect(0, 0 - 1444, 320) mAppBounds=Rect(0, 0 - 1444, 320) mWindowingMode=fullscreen mActivityType=home} s.4}
0445 01-01 17:27:31.787: D/ActivityManager(10568): [computeBounds] isInVrUiMode(getConfiguration()) = false
0446 01-01 17:27:31.787: D/ActivityManager(10568): [computeBounds] return

只能显示半屏的应用:
1186 01-01 17:27:44.124: I/ActivityManager(10568): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.android.calendar/.AllInOneActivity bnds=1153,65} from pid 11071 uid 10018
1205 01-01 17:27:44.148: D/ActivityManager(10568): [computeBounds] info = ActivityInfo{6033324 com.android.calendar.AllInOneActivity}
1206 01-01 17:27:44.148: D/ActivityManager(10568): [computeBounds] task inMultiWindowMode ? false
1207 01-01 17:27:44.148: D/ActivityManager(10568): [computeBounds] maxAspectRatio === 1.86//差异点在这里,maxAspectRatio非0,导致后面根据maxAspectRatio重新计算了maxActivityWidth的值,从而出现显示异常。这个值和hierarchyviewer中看到的layout width值相同
1217 01-01 17:27:44.149: D/ActivityManager(10568): [computeBounds] getConfiguration() == {1.0 ?mcc?mnc [zh_CN] ldltr sw426dp w1925dp h402dp 120dpi nrml long hdr land finger -keyb/v/h -nav/h winConfig={ mBounds=Rect(0, 0 - 1444, 320) mAppBounds=Rect(0, 0 - 1444, 320) mWindowingMode=fullscreen mActivityType=standard} s.4}
1218 01-01 17:27:44.149: D/ActivityManager(10568): [computeBounds] isInVrUiMode(getConfiguration()) == false
1221 01-01 17:27:44.152: D/ActivityManager(10568): [computeBounds] appBounds = Rect(0, 0 - 1444, 320)
1222 01-01 17:27:44.152: D/ActivityManager(10568): [computeBounds] maxActivityWidth = 1444 maxAspectRatio = 1.86 maxActivityHeight = 320
1223 01-01 17:27:44.152: D/ActivityManager(10568): [computeBounds] maxActivityWidth = 595

暴力修改方案:直接将maxAspectRatio置为0

更多相关文章

  1. Android(安卓)实现图片保存到本地并调用本地地址显示图片
  2. Android(安卓)设置全屏显示
  3. 安卓开发 - B站开源的ijkplayer播放器配置使用
  4. 指定Toast显示时长
  5. android 全屏显示
  6. ImageView的属性android:scaleType
  7. android 工程,点击图片,在屏幕显示
  8. CheckedTextView 复选框左显示
  9. ch02 Android(安卓)TextView与EditView

随机推荐

  1. android 设置壁纸几种方法
  2. android菜单参考资料
  3. android操作xml
  4. Android多媒体开发(5)————利用Android(
  5. Android内核的根文件系统
  6. Android动画一
  7. Android常见错误解析
  8. Android(安卓)常用布局
  9. Anfdroid网络编程方法
  10. Android进程和线程