切换视图/弹出窗口
我在切换视图时遇到了一些麻烦,想知道有人可以提供帮助。基本上初始视图是一个ListActivity。在此视图上,用户可以按下触发数据库调用的菜单按钮,当结果返回(数字或空)时,我需要将视图更改为两个视图之一(可以说是数字视图和空视图) )。
我通过这样做取得了一些成功 -
Intent myIntent = new Intent(this, numberview.class);
this.startActivity(myIntent);
现在这可以工作,但是我看不到一种将从数据库检索到的数字传递到新视图的方法。
我还尝试使用 PopUpWindow 类,但无济于事,我发现的所有示例都只有 Activity 的示例(不是 ListActivity),并且某些提到的方法不存在。我可以得到一些帮助/建议吗?
I'm having a little trouble switching views and wondering anyone can help. Basically the initial view is a ListActivity. On this view the user can press the menu button which triggers a database call and when the result comes back (either a number or a null) I require the view to be altered to one of two views (a numberview and a nullview so to speak).
I've had some success by doing -
Intent myIntent = new Intent(this, numberview.class);
this.startActivity(myIntent);
Now this works however I can't see a way to pass the number retrieved from the database into the new view.
I also tried to use the PopUpWindow class but to no avail, all the examples I found only had examples for the Activity (not ListActivity) and some of the mentioned methods don't exist. Can I get some help/advice at all please?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
试试这个:
....
在你的第二个活动中:
Try this:
....
And in your second activity: