Set path to tag IV_move. setImageResource(IDS [position]); iv_move.setTag(ids[position]); db.execSQL("insert into myaccount(png,type,money) values(? ,? ,?) ",new Object[]{in_out.getPath(),in_out.getType(),in_out.getMoney()}); db.close(); Int path= (int) iv_move.getTag(); service=new MyAccountService(this); service.add(in_out); service.list.add(in_out); Intent intent=new Intent(this, AcountListFragment.class); intent.putExtra("inout",in_out); startActivity(intent); while (cursor.moveToNext()){ int id=cursor.getInt(cursor.getColumnIndex("id")); int path=cursor.getInt(cursor.getColumnIndex("png")); String type= cursor.getString(cursor.getColumnIndex("type")); String money= cursor.getString(cursor.getColumnIndex("money")); In_Out in_out=new In_Out(R.id.iv_shu,path,type,money); list.add(in_out); }Copy the code