繁体   English   中英

如何在Android Facebook Wall中发布消息?

[英]How to post Message in android facebook wall?

我正在使用此代码在android facebookwall上发布

Bundle parameters = new Bundle();


parameters.putString("message", string);
    try {
        mFacebook.request("me");
        mFacebook.request("feed", parameters, "POST");
        Toast.makeText(MainActivity.this,
                "Message posted to your facebook wall!", Toast.LENGTH_SHORT)
                .show();
    } catch (Exception e) {

        e.printStackTrace();

    }

但是在发布时出现此错误。

    Key format expected byte[] but value was a java.lang.String.  The default value <null> was      
    returned.
    Attempt to cast generated internal exception:
   // class cast exceptions
    java.lang.ClassCastException: java.lang.String cannot be cast to byte[]
    at android.os.Bundle.getByteArray(Bundle.java:1411)
    at com.facebook.android.Util.encodePostBody(Util.java:63)
    at com.facebook.android.Util.openUrl(Util.java:182)
    at com.facebook.android.Facebook.request(Facebook.java:559)
    at com.facebook.android.AsyncFacebookRunner$2.run(AsyncFacebookRunner.java:208)

试试这个参数。putString(“ message”,“写您的帖子以显示在墙上”);

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM