安卓中的界面
我在 android 中编写了一个包含图像和视频视图的表格布局。
我想在 android 中编写一个界面,它将在不干扰我的布局的情况下获取图像以及数据和视频。
该数据可以采用任何形式、来自任何来源,并且必须通过接口提供给布局。
我应该如何为我在android中开发的布局编写程序界面?
I have written a table layout in android that contains image and video view.
I want to write an interface in android which will take the images as well as data and videos without disturbing my layout.
This data can come in any form and from any source and has to be supplied to the layout through the interface.
How should I write a program interface for the layout that I have developed in android?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
下面是Android中使用的CallBack接口的示例代码
Below is the sample code for CallBack Interface used in Android
首先你需要两个课程。
Activity
,您需要在其中显示布局并实现接口或抽象类。AsyncTask
它将把接口对象作为构造函数的输入,当此类中的任务完成时,它将通过传递数据调用第一类传递的接口对象的方法来更新第一类。接口应该在
Activity
类中定义和实现,其方法将更新第一个类的UI。如果您需要一些代码帮助,请告诉我
First you need two classes.
Activity
in which You need to display the layout and implemented the interface or abstract class.AsyncTask
which will take object of interface as input in constructor and when task in this class in completed then it will update first class by calling the method of object of interface passed by first class by passing data.Interface should be defined and implemented in
Activity
class and method of which will update the UI of first class.Please let me know if u need some code help