我按照教程從Capturing images from camera and setting into listview in android。不過,我得到無法解決R.array
Error:(42, 50) error: cannot find symbol variable array
String imageTempName;
String[] imageFor;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
listView = (ListView) findViewById(R.id.captureList);
getSets = new ArrayList<GetSet>();
imageFor = getResources().getStringArray(R.array.imageFor);
for (int i = 0; i < 3; i++) {
GetSet inflate = new GetSet();
// Global Values
inflate.setUid(String.valueOf(i));
inflate.setLabel("Image");
inflate.setHaveImage(false);
inflate.setSubtext(imageFor[i]);
inflate.setStatus(true);
getSets.add(inflate);
}
customImageAdapter = new CustomImageAdapter(getSets, MainActivity.this);
listView.setAdapter(customImageAdapter);
}
有什麼不對嗎?
在這行越來越問題? –
您存儲字符串數組 –
@ 404notfound安置自己的資源文件我按照[這](https://trinitytuts.com/capturing-images-from-camera-and-setting-into-listview-in-android/) – John