不知道为什么,但是我找不到正确的位置。单击某个按钮时,它总是给出错误的位置。我正在使用Toast进行测试:
public View getView(int i, View view, ViewGroup viewGroup) {
if (view == null) {
view = LayoutInflater.from(context).inflate(R.layout.activity_custom_row, viewGroup, false);
}
// Get position
position = i;
type = Typeface.createFromAsset(context.getAssets(),"fontawesome-webfont.ttf");
vIconComplete.setTypeface(type);
vIconComplete.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (currentTask.isClickable == true) {
// -- Displaying wrong position --
Toast.makeText(context, String.valueOf(position), Toast.LENGTH_SHORT).show();
}
}
});
return view;
}