以不同的布局将数据发送到另一个片段。 [英] Send data to one fragment from another,in different layouts.
本文介绍了以不同的布局将数据发送到另一个片段。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
喜..!我有一个标签布局应用程序。我需要在标签之间发送数据。当我点击第一个标签中的按钮,然后它进入下一个标签并显示一些数据。我经历了很多例子,但我无法找到解决方案,我花了很多天的时间。
请有人帮我找到解决方案。
非常紧急。
谢谢..
Hi..! I have an tab layout application.I need to send data between tabs.when i click a button in 1st tab,then it goes to next tab and display some data.I went through lots of examples but I was unable to have a solution and i was spend my time with lot of days.
Please Someone can help me to find a solution for that.
Its very urgent.
Thank you..
推荐答案
要在不同的片段/活动之间传递数据,请使用Application类 http://developer.android.com/reference/android/app/Application.html [ ^ ]
定义一个继承自此的新类类,并将您的数据添加为类属性,然后您可以在整个应用程序中读取。
To pass data between different Fragments / Activities use the Application class http://developer.android.com/reference/android/app/Application.html[^]
Define a new class that inherits from this class and add your data as class properties that you can then read throughout the application.
这篇关于以不同的布局将数据发送到另一个片段。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文