看板 AndroidDev 關於我們 聯絡資訊
private class inputlistviewadapter extends BaseAdapter { private Activity inActivity; private List<inputlistview> inputlistview_list; private inputlistviewadapter(Activity activity, List<inputlistview> in putlistview) { super(); this.inActivity = activity; this.inputlistview_list = inputlistview; } @Override public int getCount() { return inputlistview_list.size(); } @Override public Object getItem(int position) { return inputlistview_list.get(position); } @Override public long getItemId(int position) { return 0; } @Override public View getView(final int position, View convertView, ViewGroup pa rent) { if (convertView == null) { LayoutInflater inflater = inActivity.getLayoutInflater(); convertView = inflater.inflate(R.layout.main_row, null); } TextView a = convertView.findViewById(R.id.textView5); TextView b = convertView.findViewById(R.id.textView6); final CheckBox checkBox = convertView.findViewById(R.id.checkBox); a.setText(inputlistview_list.get(position).getTextView5()); b.setText(inputlistview_list.get(position).getTextView6()); if (editmode) { checkBox.setVisibility(View.VISIBLE); } else { checkBox.setVisibility(View.GONE); } // checkBox.setText(inputlistview_list.get(position).toString()); checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChan geListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { if (checkBox.isChecked()==true){ } } }); return convertView; } } } 請問一下要怎麼下手寫 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 114.136.103.44 ※ 文章網址: https://www.ptt.cc/bbs/AndroidDev/M.1520417628.A.5D1.html ※ 編輯: kyand4010 (110.28.75.158), 03/07/2018 18:27:20
t52101t: 1.請講清楚你的問題/哪裡不會 2.找個code分享網站貼code 03/08 14:08
t52101t: 3.文章分類... 你這篇真讓人痛苦 03/08 14:09
evo1994: 寫interface callback回activity 03/08 22:22