我看不到我的 listAdapter。我将我的项目列表传递给它,我的列表不是空的,但我得到的只是一个空屏幕。如果你能告诉我我做错了什么。
这是我的代码,我的主要活动是:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// setContentView(R.layout.listitems);
Bundle extras = getIntent().getExtras();
RssArrays RssArrays=(RssArrays) extras.get("rssItem");
ListView lv = getListView();
lv.setTextFilterEnabled(true);
// on test
listAdpterRss listAdapter = new listAdpterRss(getApplicationContext(), R.layout.listitems,RssArrays);
lv.setAdapter(listAdapter); // on test
lv.setOnItemClickListener(new OnItemClickListener()
{
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
//new splash(ListRss.this,mHandler,listValue.get(position).toString()).execute();
}
});
}}
我的适配器是
public listAdpterRss(Context context, int textViewResourceId ,RssArrays list )
{
super(context, textViewResourceId);
mContext = context;
id = textViewResourceId;
items = list ;
}
public View getView(int position, View v, ViewGroup parent)
{
View mView = v;
if(mView == null){
LayoutInflater vi = (LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
mView = vi.inflate(id, null);
}
TextView tx = (TextView) mView .findViewById(R.id.textView);
//if this view is on main screen
if (tx==null){
tx=((TextView) mView);
}
tx.setText(items.PodcastTitle[position]);