공용 클래스 MovietListAdapter는 BaseAdapter {
공개 INT getCount() { 복귀 _languagechange 확장; }
public Object getItem(int position) {
return position;
}
public long getItemId(int position) {
return position;
}
공공보기의 getView (최종 INT 위치보기 convertView, 뷰 그룹 부모) { 보기 V; LayoutInflater vi = (LayoutInflater) getSystemService (Context.LAYOUT_INFLATER_SERVICE); v = vi.inflate (R.layout.movielistdesign, null); ImageView iv = (ImageView) v.findViewById (R.id.icon);
iv.setImageDrawable(mLoader.getDrawble(position));
iv.setPadding(1, 1, 1, 1);
ImageView star = (ImageView) v.findViewById(R.id.starrating);
star.setOnClickListener (새 View.OnClickListener() {
public void onClick(View v) {
Bundle bundle = new Bundle();
bundle.putString("param1", mLoader.ds1.movie_ids[position]);
bundle.putString("param2",
mLoader.ds1.movie_titles[position]);
bundle.putString("param3",
mLoader.ds1.movie_thumbnailarray[position]);
bundle.putString("param4",
mLoader.ds1.movie_descarray[position]);
bundle.putString("param5",
mLoader.ds1.movie_rating[position]);
이 어댑터 코드를 넣습니다. – Ronnie
@harsh http://pareshnmayani.wordpress.com/tag/android-custom-listview- 예/ –
@harsh이 예제에서는 각 목록보기 항목에 컨트롤을 설정할 수 있으며 위치는 clickevent를 처리하기로 결정합니다. –