标签:
1.
Activity中设置了一个popuWindow,popuWindow有数据要返回给activity,用接口回调实现,具体如下
在popuWindow中定义一个接口:
private Callback callback; private Vector<Boolean> skills; public SkillsPopuWindow(Context context){ this.context = context; callback = (Callback)context; } skills = new Vector<Boolean>(); //此处 实例化skills的代码省略,总之,这儿是获取skills或者给skills赋值 callback.getSkills(skills); public interface Callback { public void getSkills(Vector<Boolean> skills); }
在Activity中 实现这个接口:
public class XXXActivity extends Activity implements SkillsPopuWindow.Callback{ private Vector<Boolean> skills; public void getSkills(Vector<Boolean> skills) { this.skills = skills; Log.e("skills.size=",skills.size() + ""); } }
2.
标签:
原文地址:http://blog.csdn.net/u010127250/article/details/45541019