use of com.rideread.rideread.adapter.AttentionListAdapter in project ride-read-android by Ride-Read.
the class AttentionFragment method initView.
private void initView(View mView) {
listview = (ListView) mView.findViewById(R.id.timeline_attention_listview);
View v = LayoutInflater.from(getActivity().getApplicationContext()).inflate(R.layout.timeline_newmsg_headview, null);
listview.addHeaderView(v);
AttentionListAdapter adapter = new AttentionListAdapter(lists, R.layout.timeline_attention_listitem, getContext());
listview.setAdapter(adapter);
listview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
if (position == 0) {
Toast.makeText(getContext(), "点击了消息提示", Toast.LENGTH_SHORT).show();
} else {
Intent intent = new Intent(AttentionFragment.this.getActivity(), TimelineDetailsActivity.class);
intent.putExtra("timeline", (TimeLine) parent.getAdapter().getItem(position));
startActivity(intent);
}
}
});
}
Aggregations