我想在我的应用程序中使用viewpager.我试图在一个月内每天都这样做,但我无法实现解决方案.我想创建具有相同listview概念但不同数据的页面.这是我的代码:
public final class TestFragment extends ListFragment {
private static final String KEY_CONTENT = "TestFragment:Content";
ArrayList <HashMap<String, Object>> imageliste = new ArrayList<HashMap<String, Object>>();
public class MyCustomAdapter extends ArrayAdapter<HashMap<String, Object>> {
//Bitmap bm;
public MyCustomAdapter(Context context, int textViewResourceId,
ArrayList<HashMap<String,Object>> imageliste) {
super(context, textViewResourceId,imageliste);
// TODO Auto-generated constructor stub
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
// TODO Auto-generated method stub
//return super.getView(position, convertView, parent);
View row = convertView;
if(row==null){
LayoutInflater inflater=LayoutInflater.from(getActivity());
row=inflater.inflate(R.layout.list, parent, false);
}
TextView label=(TextView)row.findViewById(R.id.text1); …Run Code Online (Sandbox Code Playgroud) 我正在尝试在我的应用中使用viewpager.
我想用listviews创建4个视图页面,每个listview只有数据会发生变化.当应用程序启动时,每个页面都会加载自己的数据,但第一次只显示第一个.
但我无法做到这一点.我的片段刷新自己的数据每个页面都有变化,所有列表视图总是有相同的数据.请帮我解决这个问题.我已经在stackoverflow上问了这个问题,但是没有人回答它.如果有一个关于它的来源你能发送链接吗?