1
我有一个整型的质量,女巫我用这样的:从SD卡一样清晰度的图像读取
final int[] iconN = new int[] { R.drawable.arrow_left_a,
R.drawable.arrow_right_a, R.drawable.sound_on,
R.drawable.sound_off };
要设置点击图片:
final ImageView bL = (ImageView) findViewById(R.id.iV1);
bL.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
bL.setImageResource(iconN[0]);
}
});
此文件是在drowable。当我以同样的方式使用SD卡上的文件时,我需要做什么? 我尝试做这样的事情:
final int[] iconC = new int[] {
Integer.parseInt(iA.getSdDir() + "/Files/Colors/arrow_left_a.png"),
Integer.parseInt(iA.getSdDir() + "/Files/Colors/arrow_right_a.png") };
但它是错的,我得到一个错误:
java.lang.NumberFormatException: unable to parse '/mnt/sdcard/izuchaika//Files/Colors/arrow_left_a.png' as integer