PSA: Android 6.0 Theme.NoDisplay Regression
2015-11-16 11:25
806 查看
登录
加入 Google+与合适的人分享合适的内容。首页个人资料人脉收藏集热门社群活动环聊信息页设置反馈帮助 · 地区隐私权 · 条款 · 地图条款
Dianne Hackborn添加到圈子29,255 位关注者|3,284,128 次查看
The reason the platform in M is now crashing the app if it doesn't use this is because not using it would previously break in very subtle and mysterious ways. For example, you would sometimes end up with your app ANRing for no reason.
Why is this? Because what Theme.NoDisplay actually does is completely prevent the window for the activity from being shown. That is, the activity gets launched, but a window for it is never displayed.
If you don't immediately finish the activity in this situation, the app is in a bad state: it has an activity being launched that the system is waiting for a window to be displayed for, but no window will ever appear. So depending on how the timing goes, you can end up with the system sitting there waiting to see the window appear, which it never does, and bam you have ANRed.
We realized we were repeatedly debugging reports from developers of their apps ANRing when they shouldn't be, tracking those problems down to misuse of Theme.NoDisplay causing their random ANRs. It is better for all of us if the platform catches this consistently, early, with a clear message about what the app did wrong.
If you really need to have a transparent activity that doesn't immediately finish, you can use Theme.Translucent.NoTitleBar to have a window that is completely transparent.翻译The CommonsBlog — PSA: Android 6.0 Theme.NoDisplay Regressioncommonsware.comMark Murphy's CommonsBlog15440
8 条评论
Shuhrat Dehkanov2015年11月5日
Sorry, but what does PSA stand for? 翻译
Chris P2015年11月5日+5
6
5
Public Service Annoucement翻译
David Gerber2015年11月5日
The real problems: 1) lack of documentation 2) no useful response onb.android.com翻译
Said Tahsin Dane2015年11月5日+1
2
1
I just created a library today which creates an Activity with no UI just to request a permission. I first wondered that why my sample application does not crash. Then, I realized that I actually usedTheme.Translucent.NoTitleBar. 翻译
Marius Gedminas2015年11月7日
And what does ANR stand for?翻译
Dianne Hackborn2015年11月8日+1
2
1
+Marius Gedminas Application Not Responding翻译
Liran Barsisa2015年11月9日
I've never used this theme. What can be its purpose? Can you give an example?
Would this be a good example: opening an activity just to show a dialog ?翻译
meng wang2015年11月11日
top翻译发表评论…
登录
加入 Google+
与合适的人分享合适的内容。
首页
个人资料
人脉
收藏集
热门
社群
活动
环聊
信息页
设置
反馈
帮助 · 地区
隐私权 · 条款 · 地图条款
Dianne Hackborn
添加到圈子
29,255 位关注者|3,284,128 次查看
公开分享 - 2015年11月5日
PSA: The new requirement to immediately finish an activity if using Theme.NoDisplay is not a regression, this has always been a requirement of it (see https://developer.android.com/reference/android/R.style.html#Theme_NoDisplay for
example).
The reason the platform in M is now crashing the app if it doesn't use this is because not using it would previously break in very subtle and mysterious ways. For example, you would sometimes end up with your app ANRing for no reason.
Why is this? Because what Theme.NoDisplay actually does is completely prevent the window for the activity from being shown. That is, the activity gets launched, but a window for it is never displayed.
If you don't immediately finish the activity in this situation, the app is in a bad state: it has an activity being launched that the system is waiting for a window to be displayed for, but no window will ever appear. So depending on how the timing goes, you
can end up with the system sitting there waiting to see the window appear, which it never does, and bam you have ANRed.
We realized we were repeatedly debugging reports from developers of their apps ANRing when they shouldn't be, tracking those problems down to misuse of Theme.NoDisplay causing their random ANRs. It is better for all of us if the platform catches this consistently,
early, with a clear message about what the app did wrong.
If you really need to have a transparent activity that doesn't immediately finish, you can use Theme.Translucent.NoTitleBar to have a window that is completely transparent.
翻译
The
CommonsBlog — PSA: Android 6.0 Theme.NoDisplay Regression
commonsware.com
Mark Murphy's CommonsBlog
154
40
8 条评论
Shuhrat Dehkanov
2015年11月5日
Sorry, but what does PSA stand for?
翻译
Chris P
2015年11月5日
+
5
6
5
Public Service Annoucement
翻译
David Gerber
2015年11月5日
The real problems: 1) lack of documentation 2) no useful response onb.android.com
翻译
Said Tahsin Dane
2015年11月5日
+
1
2
1
I just created a library today which creates an Activity with no UI just to request a permission. I first wondered that why my sample application does not crash. Then, I realized that I actually usedTheme.Translucent.NoTitleBar.
翻译
Marius Gedminas
2015年11月7日
And what does ANR stand for?
翻译
Dianne Hackborn
2015年11月8日
+
1
2
1
+Marius
Gedminas Application Not Responding
翻译
Liran Barsisa
2015年11月9日
I've never used this theme. What can be its purpose? Can you give an example?
Would this be a good example: opening an activity just to show a dialog ?
翻译
meng wang
2015年11月11日
top
翻译
发表评论…
加入 Google+与合适的人分享合适的内容。首页个人资料人脉收藏集热门社群活动环聊信息页设置反馈帮助 · 地区隐私权 · 条款 · 地图条款
Dianne Hackborn添加到圈子29,255 位关注者|3,284,128 次查看
Dianne Hackborn
公开分享 - 2015年11月5日 PSA: The new requirement to immediately finish an activity if using Theme.NoDisplay is not a regression, this has always been a requirement of it (see https://developer.android.com/reference/android/R.style.html#Theme_NoDisplay for example).The reason the platform in M is now crashing the app if it doesn't use this is because not using it would previously break in very subtle and mysterious ways. For example, you would sometimes end up with your app ANRing for no reason.
Why is this? Because what Theme.NoDisplay actually does is completely prevent the window for the activity from being shown. That is, the activity gets launched, but a window for it is never displayed.
If you don't immediately finish the activity in this situation, the app is in a bad state: it has an activity being launched that the system is waiting for a window to be displayed for, but no window will ever appear. So depending on how the timing goes, you can end up with the system sitting there waiting to see the window appear, which it never does, and bam you have ANRed.
We realized we were repeatedly debugging reports from developers of their apps ANRing when they shouldn't be, tracking those problems down to misuse of Theme.NoDisplay causing their random ANRs. It is better for all of us if the platform catches this consistently, early, with a clear message about what the app did wrong.
If you really need to have a transparent activity that doesn't immediately finish, you can use Theme.Translucent.NoTitleBar to have a window that is completely transparent.翻译The CommonsBlog — PSA: Android 6.0 Theme.NoDisplay Regressioncommonsware.comMark Murphy's CommonsBlog15440
8 条评论
Shuhrat Dehkanov2015年11月5日
Sorry, but what does PSA stand for? 翻译
Chris P2015年11月5日+5
6
5
Public Service Annoucement翻译
David Gerber2015年11月5日
The real problems: 1) lack of documentation 2) no useful response onb.android.com翻译
Said Tahsin Dane2015年11月5日+1
2
1
I just created a library today which creates an Activity with no UI just to request a permission. I first wondered that why my sample application does not crash. Then, I realized that I actually usedTheme.Translucent.NoTitleBar. 翻译
Marius Gedminas2015年11月7日
And what does ANR stand for?翻译
Dianne Hackborn2015年11月8日+1
2
1
+Marius Gedminas Application Not Responding翻译
Liran Barsisa2015年11月9日
I've never used this theme. What can be its purpose? Can you give an example?
Would this be a good example: opening an activity just to show a dialog ?翻译
meng wang2015年11月11日
top翻译发表评论…
登录
加入 Google+
与合适的人分享合适的内容。
首页
个人资料
人脉
收藏集
热门
社群
活动
环聊
信息页
设置
反馈
帮助 · 地区
隐私权 · 条款 · 地图条款
Dianne Hackborn
添加到圈子
29,255 位关注者|3,284,128 次查看
Dianne Hackborn
公开分享 - 2015年11月5日PSA: The new requirement to immediately finish an activity if using Theme.NoDisplay is not a regression, this has always been a requirement of it (see https://developer.android.com/reference/android/R.style.html#Theme_NoDisplay for
example).
The reason the platform in M is now crashing the app if it doesn't use this is because not using it would previously break in very subtle and mysterious ways. For example, you would sometimes end up with your app ANRing for no reason.
Why is this? Because what Theme.NoDisplay actually does is completely prevent the window for the activity from being shown. That is, the activity gets launched, but a window for it is never displayed.
If you don't immediately finish the activity in this situation, the app is in a bad state: it has an activity being launched that the system is waiting for a window to be displayed for, but no window will ever appear. So depending on how the timing goes, you
can end up with the system sitting there waiting to see the window appear, which it never does, and bam you have ANRed.
We realized we were repeatedly debugging reports from developers of their apps ANRing when they shouldn't be, tracking those problems down to misuse of Theme.NoDisplay causing their random ANRs. It is better for all of us if the platform catches this consistently,
early, with a clear message about what the app did wrong.
If you really need to have a transparent activity that doesn't immediately finish, you can use Theme.Translucent.NoTitleBar to have a window that is completely transparent.
翻译
The
CommonsBlog — PSA: Android 6.0 Theme.NoDisplay Regression
commonsware.com
Mark Murphy's CommonsBlog
154
40
8 条评论
Shuhrat Dehkanov
2015年11月5日
Sorry, but what does PSA stand for?
翻译
Chris P
2015年11月5日
+
5
6
5
Public Service Annoucement
翻译
David Gerber
2015年11月5日
The real problems: 1) lack of documentation 2) no useful response onb.android.com
翻译
Said Tahsin Dane
2015年11月5日
+
1
2
1
I just created a library today which creates an Activity with no UI just to request a permission. I first wondered that why my sample application does not crash. Then, I realized that I actually usedTheme.Translucent.NoTitleBar.
翻译
Marius Gedminas
2015年11月7日
And what does ANR stand for?
翻译
Dianne Hackborn
2015年11月8日
+
1
2
1
+Marius
Gedminas Application Not Responding
翻译
Liran Barsisa
2015年11月9日
I've never used this theme. What can be its purpose? Can you give an example?
Would this be a good example: opening an activity just to show a dialog ?
翻译
meng wang
2015年11月11日
top
翻译
发表评论…
相关文章推荐
- QQ聊天之Android显示Gif ——在TextView中添加动态表情
- android四大组件之BroadcastReceiver短信拦截功能
- 新的起点 -- 开始奔跑 -- 开博篇
- Android图片查看支持双击放大缩小、多点触摸(多机型测试,长期使用很稳定)
- Android获取网页数据的方法总结
- 去除AndroidManifest.xml uses-sdk警告方法
- Android内存中的图片
- Android tips(一)-->Android SDK镜像的介绍使用
- Zxing 竖屏切换 android
- Android项目打包成APK文件
- Sharing code between unit tests and instrumentation tests on Android
- Windows下Android NDK开发的几种方法总结
- android:process=":remote"
- H5页面调用android上传,支持input-file
- 米推(MiPush)简述
- Android基础——HTML网页源码的获取
- RAD Studio10免费培训之Android Service新特性——讲义及范例程序下载
- Android-Universal-Image-Loader 图片异步加载类库的使用(超详细配置)
- ViewPager设置一次显示的页面个数
- android 启动不起来