更少的代码解决同样的问题。

String[]转String

来自XXX.java
StringBuffer buffer =
new
StringBuffer();
String projectionList =
null
;
if
(mProjection !=
null
) {
for
(String p : mProjection) {
buffer.append(p);
buffer.append(
" "
);
}
projectionList = buffer.toString();
}
logDebug(
"mDataUri: "
+ mDataUri +
" mProjection: "
+ projectionList +
" mPrimargyKey: "
+ mPrimaryKey);

代码review意见:如果你不介意内容格式的话:建议用Arrays.toString(),这个可以顶替你好多代码。

提交者abandon,重新修改后的代码:

改进后的代码
logDebug(
"mDataUri: "
+ mDataUri +
" mProjection: "
+ Arrays.toString(mProjection) + " mPrima
rgyKey: " + mPrimaryKey);