我刚开始使用android而且遇到了一些问题.
我创建了一个ListView从数据库填充的.
每行都有一个按钮,用于从列表和数据库中删除项目.
我能够将事件监听器连接到按钮,但我无法确定要删除的匹配数据库记录.
我的班级如下所示
public class FeedArrayAdapter extends ArrayAdapter<Feed> implements OnClickListener
{
private ARssEReaderDBAdapter dba;
private String TAG = "FeedArrayAdapter";
public FeedArrayAdapter(Context context, int textViewResourceId, List<Feed> items) {
super(context, textViewResourceId, items);
Log.w(TAG, "List");
@Override
public View getView(int position, View convertView, ViewGroup parent) {
Log.w(TAG, "getView");
View v = convertView;
if (v == null) {
LayoutInflater vi = (LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
v = vi.inflate(R.layout.feedlistrow, null);
}
Feed feed = getItem(position);
if (feed != null) {
TextView title = (TextView)v.findViewById(R.id.TextView01);
if …Run Code Online (Sandbox Code Playgroud)