Search in sources :

Example 1 with NewsContentItem

use of cn.eoe.app.entity.NewsContentItem in project android-app by eoecn.

the class NewsFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreateView(inflater, container, savedInstanceState);
    listview.setXListViewListener(this);
    // construct the RelativeLayout
    mAdapter = new MyAdapter();
    mAdapter.appendToList(items_list);
    listview.setAdapter(mAdapter);
    listview.setOnItemClickListener(new OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            // TODO Auto-generated method stub
            NewsContentItem item = (NewsContentItem) mAdapter.getItem(position - 1);
            startDetailActivity(mActivity, item.getDetail_url(), "资讯", item.getTitle());
        }
    });
    return view;
}
Also used : OnItemClickListener(android.widget.AdapterView.OnItemClickListener) NewsContentItem(cn.eoe.app.entity.NewsContentItem) ImageView(android.widget.ImageView) TextView(android.widget.TextView) View(android.view.View) AdapterView(android.widget.AdapterView) SuppressLint(android.annotation.SuppressLint)

Aggregations

SuppressLint (android.annotation.SuppressLint)1 View (android.view.View)1 AdapterView (android.widget.AdapterView)1 OnItemClickListener (android.widget.AdapterView.OnItemClickListener)1 ImageView (android.widget.ImageView)1 TextView (android.widget.TextView)1 NewsContentItem (cn.eoe.app.entity.NewsContentItem)1