我采取了以下数组;填充画廊:
private Integer[] mImageIds = { R.drawable.one, R.drawable.two,
R.drawable.three, R.drawable.four, R.drawable.five,
R.drawable.six, R.drawable.seven, R.drawable.eight,
R.drawable.nine, R.drawable.ten, R.drawable.elevan,
R.drawable.twelve, R.drawable.thirteen, R.drawable.fouteen,
R.drawable.fifteen, R.drawable.sixteen
};
然后我正在使用画廊的点击事件:
coverFlow.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView arg0, View v, int position,
long rowID) {
String s = mImageIds[position].toString();
Toast.makeText(v.getContext(), s , 1000).show();
}
});
但是这里 Toast 给了我整数2130837507;
如果我只在 Toast 中使用mImageIds[position]
然后它显示路径res/drawable-mdpi/image_name.jpg,但实际上它不是字符串。我想从中检索字符串(图像名称)。谁能帮我?