我在使用从 http://github.com/facebook/facebook-android-sdk 下载的 Android FB SDK 时遇到了问题。尝试发布内容到墙上,但总是出现错误(权限已设置,并且已登录到 FB)。
以下是我的 onClick 函数代码片段,我对他们的示例代码进行了一些小修改:
以下是我的 onClick 函数代码片段,我对他们的示例代码进行了一些小修改:
Bundle params = new Bundle();
params.putString("message", "Test");
params.putString("name", "American Virgin");
params.putString("link", "http://bit.ly/12345");
params.putString("description", "A Freshman College Girl on a scholarship from an ...");
params.putString("picture", "http://xxx/MOV1026.jpg");
mAsyncRunner.request("me/feed", params, "POST", new TestRequestListener());
我从 DDMS 得到以下错误:
09-16 18:55:28.372: WARN/Bundle(14392): Key picture expected byte[] but value was a java.lang.String. The default value <null> was returned.
09-16 18:55:28.414: WARN/Bundle(14392): Attempt to cast generated internal exception:
09-16 18:55:28.414: WARN/Bundle(14392): java.lang.ClassCastException: java.lang.String
09-16 18:55:28.414: WARN/Bundle(14392): at android.os.Bundle.getByteArray(Bundle.java:1220)
09-16 18:55:28.414: WARN/Bundle(14392): at com.facebook.android.Util.openUrl(Util.java:153)
09-16 18:55:28.414: WARN/Bundle(14392): at com.facebook.android.Facebook.request(Facebook.java:295)
09-16 18:55:28.414: WARN/Bundle(14392): at com.facebook.android.AsyncFacebookRunner$2.run(AsyncFacebookRunner.java:209)
09-16 18:55:28.422: WARN/Bundle(14392): Key message expected byte[] but value was a java.lang.String. The default value <null> was returned.
09-16 18:55:28.432: WARN/Bundle(14392): Attempt to cast generated internal exception:
09-16 18:55:28.432: WARN/Bundle(14392): java.lang.ClassCastException: java.lang.String
09-16 18:55:28.432: WARN/Bundle(14392): at android.os.Bundle.getByteArray(Bundle.java:1220)
09-16 18:55:28.432: WARN/Bundle(14392): at com.facebook.android.Util.openUrl(Util.java:153)
09-16 18:55:28.432: WARN/Bundle(14392): at com.facebook.android.Facebook.request(Facebook.java:295)
09-16 18:55:28.432: WARN/Bundle(14392): at com.facebook.android.AsyncFacebookRunner$2.run(AsyncFacebookRunner.java:209)
09-16 18:55:28.452: WARN/Bundle(14392): Key format expected byte[] but value was a java.lang.String. The default value <null> was returned.
09-16 18:55:28.472: WARN/Bundle(14392): Attempt to cast generated internal exception:
09-16 18:55:28.472: WARN/Bundle(14392): java.lang.ClassCastException: java.lang.String
09-16 18:55:28.472: WARN/Bundle(14392): at android.os.Bundle.getByteArray(Bundle.java:1220)
09-16 18:55:28.472: WARN/Bundle(14392): at com.facebook.android.Util.openUrl(Util.java:153)
09-16 18:55:28.472: WARN/Bundle(14392): at com.facebook.android.Facebook.request(Facebook.java:295)
09-16 18:55:28.472: WARN/Bundle(14392): at com.facebook.android.AsyncFacebookRunner$2.run(AsyncFacebookRunner.java:209)