我正在使用Parse.com查询适配器来填充我的listview片段。我运行时数据似乎加载,但它只显示行,而不是数据。
此外,当我在listview Activity中使用适配器时,数据加载完全正常。
public class imboard extends FragmentActivity实现了ActionBar.TabListener {
@覆盖
public android.app.Fragment getItem(int position) {
return MyFavs.FavInstance();
}
}
public class MyFavs extends Fragment实现了View.OnClickListener {
@覆盖
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View myFavView = inflater.inflate(R.layout.fragment_favorites, container, false);
ListView listView = (ListView) myFavView.findViewById(R.id.favList);
FavoriteAdapter favoriteAdapter = new FavoriteAdapter(getActivity());
ParseQueryAdapter<CladPost> mainAdapter =
new ParseQueryAdapter<>(getActivity(), CladPost.class);
mainAdapter.setTextKey("title");
listView.setAdapter(mainAdapter);
favoriteAdapter.loadObjects();
return myFavView;
}
}