我试过这段代码:
int checkExistence = mContext.getResources().getIdentifier("file", "values", mContext.getPackageName());
if ( checkExistence != 0 ) { // the resouce exists...
result = true;
}
else { // checkExistence == 0 // the resouce does NOT exist!!
result = false;
}
但结果总是错误的。有谁知道另一种方法?
谢谢;)