public class Myfragment extends Fragment implements XListView.IXListViewListener {
private XListView xListView;
private int index=1;
private Myfragment.myadapter myadapter;
private boolean ifadd;
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
return inflater.inflate(R.layout.myfragment01,container,false);
}
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
View view = getView();
xListView = (XListView) view.findViewById(R.id.myxlistview);
xListView.setPullLoadEnable(true);
xListView.setXListViewListener(this);
addintent();
}
private void addintent() {
RequestParams params=new RequestParams("http://apis.juhe.cn/cook/query.php");
params.addQueryStringParameter("key","4828e85e3b04e4b0d7ac8afab28a39cf");
params.addQueryStringParameter("menu","小鸡炖蘑菇");
private XListView xListView;
private int index=1;
private Myfragment.myadapter myadapter;
private boolean ifadd;
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
return inflater.inflate(R.layout.myfragment01,container,false);
}
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
View view = getView();
xListView = (XListView) view.findViewById(R.id.myxlistview);
xListView.setPullLoadEnable(true);
xListView.setXListViewListener(this);
addintent();
}
private void addintent() {
RequestParams params=new RequestParams("http://apis.juhe.cn/cook/query.php");
params.addQueryStringParameter("key","4828e85e3b04e4b0d7ac8afab28a39cf");
params.addQueryStringParameter("menu","小鸡炖蘑菇");