[英]Adding configChanges =“locale” programmatically
I use configChanges="locale" on my activities. 我在活动中使用configChanges =“ locale”。 Without this options in AndroidManifest.xml
in 2.x
, I am getting flickering screens. 如果在2.x
AndroidManifest.xml
中没有此选项,则屏幕会闪烁。
It works in all my activities except in the preferences screen in which I have added programmatically. 它可用于我的所有活动,但在以编程方式添加的首选项屏幕中除外。 I have one Preference Activity --> It works after setting configChanges="locale" to the AndroidManifest.xml. 我有一个首选项活动->在将configChanges =“ locale”设置为AndroidManifest.xml后可以使用。
Inside of the Preference Activity, I add programmatically a new preferencescreen. 在“首选项活动”内部,以编程方式添加了一个新的“首选项”屏幕。 For this new PreferenceScreen, I don't have an activity in the AndroidManifest.xml! 对于此新的PreferenceScreen,AndroidManifest.xml中没有活动! So I cannot add the configChanges="locale" and the screen flickers on 2.x !! 所以我无法添加configChanges =“ locale”,并且屏幕在2.x上闪烁!
How can I add the attribute configChanges="locale" programmatically? 如何以编程方式添加属性configChanges =“ locale”?
I have not found a solution to add configChanges="locale"
programmatically, but i created a new Pereference Activity and added the configChanges keyword to the Manifest file. 我还没有找到以编程方式添加configChanges="locale"
方案,但是我创建了一个新的Pereference Activity并将configChanges关键字添加到清单文件中。
Now it works as it should. 现在它可以正常工作了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.