1。event 总类
package com.louisgeek.louisdemo;
/**
* Created by louisgeek on 2016/4/3.
*/
public class EventAll {
class EventLoadData{
private int pos;
public EventLoadData(int pos) {
this.pos = pos;
}
public int getPos() {
return pos;
}
}
//other event class
class EventAddData{
private int pos;
public EventAddData(int pos) {
this.pos = pos;
}
public int getPos() {
return pos;
}
}
}
2。
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
//内部类 new A().new B();
EventBus.getDefault().post(new EventAll().new EventLoadData(position));
}
});
3。刷新数据
@Subscribe(threadMode = ThreadMode.MAIN)
public void onEveMain(EventAll.EventLoadData eventLoadData)
{
int pos=eventLoadData.getPos();
// onLoad(pos);
}