从 TabActivity 启动 PreferenceActivity
我有一个 TabActivity,它在应用程序启动时启动。它包含 3 个选项卡。 我在 OptionMenu 中添加了一个 Settings 选项,单击该选项会启动自定义 PreferenceActivity
。这是一个简单的活动 addPreferencesFromResource(R.xml.preferences);
在其 onCreate
方法中。但是,当用户单击 Settings
选项时,我收到此警告,但根本没有显示任何内容:
07-07 13:07:56.397: WARN/InputManagerService(110): 窗口已聚焦,忽略焦点增益:com.android.internal.view.IInputMethodClient$Stub$Proxy@4075fa28
这到底是什么问题?是否有任何特殊的方法来处理 TabActivity
中的调用活动。如何解决这个问题?
提前致谢。
I have a TabActivity
which starts when the application is launched. It contains 3 tabs.
I have added a Settings option in the OptionMenu which when clicked starts a custom PreferenceActivity
. it is a simple activity which doesaddPreferencesFromResource(R.xml.preferences);
in its onCreate
method. However, when the user clicks on the Settings
option, I receive this warning and nothing is shown at all :
07-07 13:07:56.397: WARN/InputManagerService(110): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@4075fa28
What exactly is the problem with this? Is there any special way to handle Calling Activities inside TabActivity
. How to fix this?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
使用意图框架来指示要启动哪个自定义
PreferenceActivity
。我想就像下面这样。getTabHost().addTabSpec().setContent(yourIntentHere);
Use the intent framework that indicates which custom
PreferenceActivity
to start. Something like below, I think.getTabHost().addTabSpec().setContent(yourIntentHere);
这就是我所做的:
然后,对于每个选项卡:
Here's what I do:
Then, for each tab:
我没有使用
xml
,而是在每个活动中以编程方式执行此操作,并且效果很好。Instead of the using the
xml
, I did this programmatically inside each of the activities and it worked fine.