use of android.widget.AdapterView.OnItemClickListener in project android-app by eoecn.
the class BlogFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
super.onCreateView(inflater, container, savedInstanceState);
listview.setXListViewListener(this);
// construct the RelativeLayout
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
BlogContentItem item = (BlogContentItem) mAdapter.getItem(position - 1);
startDetailActivity(mActivity, item.getDetail_url(), "博客", item.getTitle());
}
});
return view;
}
use of android.widget.AdapterView.OnItemClickListener 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;
}
use of android.widget.AdapterView.OnItemClickListener in project android-app by eoecn.
the class MainActivity method initListView.
private void initListView() {
lvAdapter = new SimpleAdapter(this, getData(), R.layout.behind_list_show, new String[] { LIST_TEXT, LIST_IMAGEVIEW }, new int[] { R.id.textview_behind_title, R.id.imageview_behind_icon }) {
@Override
public View getView(int position, View convertView, ViewGroup parent) {
// TODO Auto-generated method stub.
View view = super.getView(position, convertView, parent);
if (position == mTag) {
view.setBackgroundResource(R.drawable.back_behind_list);
lvTitle.setTag(view);
} else {
view.setBackgroundColor(Color.TRANSPARENT);
}
return view;
}
};
lvTitle.setAdapter(lvAdapter);
lvTitle.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
NavigationModel navModel = navs.get(position);
mAboveTitle.setText(navModel.getName());
current_page = navModel.getTags();
if (lvTitle.getTag() != null) {
if (lvTitle.getTag() == view) {
MainActivity.this.showContent();
return;
}
((View) lvTitle.getTag()).setBackgroundColor(Color.TRANSPARENT);
}
lvTitle.setTag(view);
view.setBackgroundResource(R.drawable.back_behind_list);
imgQuery.setVisibility(View.VISIBLE);
switch(position) {
case 0:
imgQuery.setVisibility(View.GONE);
new MyTask().execute(topDao);
break;
case 1:
new MyTask().execute(newsDao);
break;
case 2:
new MyTask().execute(wikiDao);
break;
case 3:
new MyTask().execute(blogsDao);
break;
}
}
});
}
use of android.widget.AdapterView.OnItemClickListener in project standup-timer by jwood.
the class TeamDetails method createMeetingListClickListener.
private OnItemClickListener createMeetingListClickListener() {
return new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
String meetingTime = meetingListAdapter.getItem(position);
Intent intent = new Intent(TeamDetails.this, MeetingDetails.class);
intent.putExtra("teamName", team.getName());
intent.putExtra("meetingTime", meetingTime);
startActivity(intent);
}
};
}
use of android.widget.AdapterView.OnItemClickListener in project qksms by moezbhatti.
the class QKDialog method setDoubleLineItems.
public QKDialog setDoubleLineItems(String[] titles, String[] bodies, final OnItemClickListener onClickListener) {
int size = Math.min(titles.length, bodies.length);
DoubleLineListItem[] doubleLineListItems = new DoubleLineListItem[size];
for (int i = 0; i < size; i++) {
doubleLineListItems[i] = new DoubleLineListItem();
doubleLineListItems[i].title = titles[i];
doubleLineListItems[i].body = bodies[i];
}
ArrayAdapter adapter = new DoubleLineArrayAdapter(mContext, doubleLineListItems);
ListView listView = new ListView(mContext);
listView.setAdapter(adapter);
listView.setDivider(null);
listView.setPadding(0, Units.dpToPx(mContext, 8), 0, Units.dpToPx(mContext, 8));
listView.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
if (onClickListener != null) {
onClickListener.onItemClick(parent, view, position, id);
dismiss();
}
}
});
return setCustomView(listView);
}
Aggregations