안녕하세요.
도저히 뭐가 잘못된건지 모르겠습니다.
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
Toast t = Toast.makeText(DateListActivity.this, "aaaaaaaaaaaa", Toast.LENGTH_SHORT);
t.show();
}
이부분이 실행이 안됩니다....
다른 리스트 뷰 구현에서는 이상이 없는데 해당 부분만 저렇게 됩니다.
리스트 뷰 커스터마이징 부분에서 웹뷰가 들어가서 그러나요?????
도저히 모르겠습니다.... ㅜㅜ
public class DateListActivity extends Activity implements InitSetting, OnClickListener, OnItemClickListener{
ImageButton mBtnBottomList;
ImageButton mBtnBottomMap;
ImageButton mBtnBottomBasket;
ImageButton mBtnBottomCoupon;
ListView mLv;
ArrayList<DateListData> mDatas;
DateListDataManager mData;
DateListDataAdapter mAdapter;
Handler mListHandler = new Handler();
ProgressDialog progDialog;
Button mBtnMore;
Button mSearchTotal;
Button mSearchNew;
Button mSearchPopularity;
int page;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.datelist);
Intent intent = getIntent();
String locationName = intent.getStringExtra("locationName");
((TextView)findViewById(R.id.datelist_headertitle)).setText(locationName);
viewSetting();
init();
}
public void viewSetting(){
mBtnBottomList = (ImageButton)findViewById(R.id.datelist_btn_bottom_list);
mBtnBottomList.setOnClickListener(this);
mBtnBottomMap = (ImageButton)findViewById(R.id.datelist_btn_bottom_map);
mBtnBottomMap.setOnClickListener(this);
mBtnBottomBasket = (ImageButton)findViewById(R.id.datelist_btn_bottom_basket);
mBtnBottomBasket.setOnClickListener(this);
mBtnBottomCoupon = (ImageButton)findViewById(R.id.datelist_btn_bottom_coupon);
mBtnBottomCoupon.setOnClickListener(this);
mLv = (ListView)findViewById(R.id.datelist_listcontent);
mLv.setOnItemClickListener(this);
mBtnMore = (Button)findViewById(R.id.datelist_btn_more);
mBtnMore.setOnClickListener(this);
mSearchTotal = (Button)findViewById(R.id.datelist_btn_top_total);
mSearchTotal.setOnClickListener(this);
mSearchNew = (Button)findViewById(R.id.datelist_btn_top_popularity);
mSearchNew.setOnClickListener(this);
mSearchPopularity = (Button)findViewById(R.id.datelist_btn_top_new);
mSearchPopularity.setOnClickListener(this);
page = 0;
}
public void init(){
progDialog = new ProgressDialog( this );
progDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
progDialog.setMessage("로딩중 입니다");
progDialog.show();
Thread tList = new Thread(){
public void run(){
Intent intent = getIntent();
mDatas = new ArrayList<DateListData>();
mData = new DateListDataManager();
mDatas = mData.getContactList(page, mDatas);
mAdapter = new DateListDataAdapter(DateListActivity.this, R.layout.datelist_list, mDatas);
mListHandler.post( new Runnable() {
public void run() {
mLv.setAdapter(mAdapter);
progDialog.dismiss();
}
});
}
};
tList.start();
}
@Override
public void onClick(View v) {
Intent intent;
if(v.equals(mBtnBottomList)){ // 리스트
intent = new Intent(DateListActivity.this, TestActivity.class);
startActivity(intent);
}else if(v.equals(mBtnBottomMap)){ // 지도
}else if(v.equals(mBtnBottomBasket)){ // 장바구니
}else if(v.equals(mSearchTotal)){ // 정렬 전체
}else if(v.equals(mSearchNew)){ // 정렬 새로운
}else if(v.equals(mSearchPopularity)){ // 정렬 인기
}else if(v.equals(mBtnMore)){ // 쿠폰
progDialog.show();
page++;
mBtnMore.setText(String.format("더 보기 ( 현재 %d Page)", page));
Thread btnList = new Thread(){
public void run(){
Intent intent = getIntent();
mDatas = mData.getContactList(page, mDatas);
mListHandler.post( new Runnable() {
public void run() {
mAdapter.notifyDataSetChanged();
progDialog.dismiss();
}
});
}
};
btnList.start();
}
VibratorEvent.jingEvent(DateListActivity.this);
}
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
Toast t = Toast.makeText(DateListActivity.this, "aaaaaaaaaaaa", Toast.LENGTH_SHORT);
t.show();
}
}
********************************************** 메인 *****************************************
<?xml version="1.0" encoding="utf-8"?>
<Button android:id="@+id/datelist_btn_more"
android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/more_list" />
<ListView android:background="#FFFFFF" android:id="@+id/datelist_listcontent"
android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1" />
</LinearLayout>
************************************** 리스트 *******************************************
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:paddingLeft="7dp" android:paddingRight="6dp"
android:paddingTop="10dp" android:paddingBottom="10dp"
android:background="@drawable/grouped_rect">
<RelativeLayout android:layout_width="96dp"
android:layout_height="64dp" android:paddingRight="5dp">
<WebView android:id="@+id/datelist_list_thumbnail"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:padding="0sp" />
<ImageView android:layout_width="96dp" android:id="@+id/datelist_list_frame"
android:layout_height="64dp" android:background="@null"
android:src="@drawable/thumbnail_frame" android:padding="0dp" />
<ImageView android:id="@+id/datelist_list_new_mark"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:background="@null" android:src="@drawable/icon_new"
android:visibility="invisible" />
</RelativeLayout>
<LinearLayout android:layout_width="wrap_content"
android:layout_height="wrap_content" android:orientation="vertical">
<TextView android:id="@+id/datelist_list_datename"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:textColor="@color/list_text_color" android:textSize="@dimen/detail_title"
android:maxLines="1" />
<TextView android:id="@+id/datelist_list_datenlocation"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:textColor="@color/list_sub_text_color" android:maxLines="1" />
<com.yanolja.android.date.app.view.RatingStar
android:id="@+id/datelist_list_rating" android:layout_marginTop="1dp"
android:layout_width="wrap_content" android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>




뷰셋팅 mLv.setOnItemClickListener(this);
이부분을 아래처럼 변경하시고
mLvt.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
long arg3) {
// TODO Auto-generated method stub
// 이부분에 한번 로그를찍어보세요
}
});