String转换成可变参数的BUG,求大神帮忙解决一下,实在不知道如何解决。

java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Object[]
at android.util.ArrayMap.allocArrays(ArrayMap.java:171)
at android.util.ArrayMap.put(ArrayMap.java:444)
at android.os.Bundle.putString(Bundle.java:519)
at com.customviews.dialogs.SimpleDialogFragment$SimpleDialogBuilder.setMessage(Unknown Source)
setPositiveButtonText
setOnNegativeButtonListenter
prepareArguments
at com.customviews.dialogs.BaseDialogBuilder.show(Unknown Source)
at com.customviews.dialogs.SimpleDialogFragment$SimpleDialogBuilder.setPositiveButtonText(Unknown Source)
setNeutralButtonText
setOnNeutralButtonListenter
show
at com.netschool.main.ui.DailyTrainingSettingsActivity.onWindowFocusChanged(Unknown Source)
at com.android.internal.policy.impl.PhoneWindow$DecorView.onWindowFocusChanged(PhoneWindow.java:2878)
at android.view.View.dispatchWindowFocusChanged(View.java:8315)
at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:978)
at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:3541)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:157)
at android.app.ActivityThread.main(ActivityThread.java:5293)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
at dalvik.system.NativeStart.main(Native Method)

下面是代码部分

```public SimpleDialogBuilder setMessage(int resourceId,
Object... formatArgs) {
mMessage = Html.fromHtml(String.format(Html
.toHtml(new SpannedString(mContext.getText(resourceId))),
formatArgs));
return this;
}


查看全部
Z_dong_dong
Z_dong_dong
2015/06/09 08:08
  • bug
  • android
  • 可变参数
  • 点赞
  • 收藏
  • 回答
    私信

9个回复