DB에서 일부 데이터를 가져 와서 TextView를 올바르게 채 웁니다. 내가 겪고있는 문제는 버튼에서 아무 것도하지 않는 버튼을 클릭했을 때입니다. onClick에서 코드 완성을 추가했지만 버튼이 응답하지 않습니다. 다른 스택 게시물을보고 솔루션을 시도했지만 작동하지 않습니다. 나는 그것이 내가 놓치고있는 명백한 무엇인가 확실하다. 여기에 내 코드 listAdapter의 버튼이 작동하지 않습니다.
<TableRow
android:id="@+id/visitorNotLeft"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="@+id/names"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="" />
<TextView
android:id="@+id/companies"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="" />
<Button
android:id="@+id/timeOut"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:focusable="false"
android:focusableInTouchMode="false"
android:descendantFocusability="blocksDescendants"
android:layout_weight="1"
android:text="@string/timeOut" />
</TableRow>
@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
// TODO Auto-generated method stub
super.onListItemClick(l, v, position, id);
timeOut = (Button)v.findViewById(R.id.timeOut);
timeOut.setTag(position);
timeOut.setFocusable(false);
timeOut.setFocusableInTouchMode(false);
timeOut.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
finish();
}
});
}
당신은 내가 더 많은 코드가 알려 추가하려는 경우 여기 내 어댑터 코드
@Override
protected void onPostExecute(String result) {
// TODO Auto-generated method stub
ListAdapter adapter = new SimpleAdapter(GetDataFromDB.this,
productsList, R.layout.list_of_visitors_not_signed_out,
new String[] { TAG_NAME, TAG_COMPANY }, new int[] {
R.id.names, R.id.companies });
// updating listview
setListAdapter(adapter);
}
가
<?xml version="1.0" encoding="utf-8"?>
입니다.
에 대한 어떠한하지 분명한 것은 다시 나를 먹이 –
당신이 당신의 어댑터를 게시 할 수 코드 ??? –
방금 어댑터 코드 – Aaron