80,351
社区成员
发帖
与我相关
我的任务
分享
public void onItemSelected(AdapterView<?> arg0, View view, int position, long id) {
Toast.makeText(getApplicationContext(), "Action Selected: position=" + position + " id=" + id, Toast.LENGTH_SHORT).show();
mPosition = position;
}
public class simpleCursorAdapter extends SimpleCursorAdapter
{
public simpleCursorAdapter(Context context, int layout, Cursor c, String[] from, int[] to)
{
super(context, layout, c, from, to);
// TODO Auto-generated constructor stub
}
//重写bindView方法
public void bindView(View view, Context context, Cursor cursor)
{
//绑定数据到view ,test
TextView name = (TextView) view.findViewById(android.R.id.text1);
TextView message = (TextView) view.findViewById(android.R.id.text2 );
name.setText("剩余"+cursor.getString(1)+"小时"+cursor.getString(2)+"分钟");
//message.setText(cursor.getString(2));
//ItemCathe ic = new ItemCathe();
//设置tag标记行
view.setTag(cursor.getString(0));
message.setText(cursor.getString(3)+view.getTag());
super.bindView(view, context, cursor);
}
}