我正在尝试使用页脚填充我的 ListView。出于这个原因,我创建了一个片段。但是我在将数据传递给片段时遇到问题。在不同的地方它工作得很好,就像我做的那样。
listView1 = (ListView) findViewById(R.id.listView1);
MenueAdapter adapter = new MenueAdapter(MainActivity.this,
R.layout.mainview_menue_item_row, data_Storage_news,
getWindowManager().getDefaultDisplay().getWidth());
Intent intent_onTv = new Intent(context,
OnTvFragment.class);
intent_onTv.putExtra("data_Storage_tv", data_Storage_tv);
OnTvFragment frag = new OnTvFragment();
frag.setArguments(intent_onTv.getExtras());
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
ft.commit();
LayoutInflater inflater = getLayoutInflater();
View footer = inflater.inflate(R.layout.ontv_fragment, null);
getSupportFragmentManager().executePendingTransactions();
listView1.addFooterView(footer);
listView1.setAdapter(adapter);
Fragment 包含一个 ViewFlipper 并且在另一个活动中工作得很好。
任何人都知道我做错了什么,或者可以告诉我正确的方法吗?