Facebook SDK 4+;-以编程方式发布到我自己的墙(Android)

Facebook SDK 4+;-以编程方式发布到我自己的墙(Android),android,facebook-sdk-4.0,Android,Facebook Sdk 4.0,有人能告诉我一种方法,如何在没有共享对话框的情况下以编程方式发布墙贴吗。我知道当用户的帐户首次连接到我们的应用程序时,应该询问哪些权限。但是在用户提供了权限之后,我应该能够发布更新。 我想发布流和发布操作是我需要包括的 这是否有用: AccessToken accessToken = AccessToken.getCurrentAccessToken(); Bundle postParams = new Bundle();

有人能告诉我一种方法,如何在没有共享对话框的情况下以编程方式发布墙贴吗。我知道当用户的帐户首次连接到我们的应用程序时,应该询问哪些权限。但是在用户提供了权限之后,我应该能够发布更新。 我想发布流和发布操作是我需要包括的

这是否有用:

            AccessToken accessToken = AccessToken.getCurrentAccessToken();

            Bundle postParams = new Bundle();
            postParams.putString("name", "yourTitle");
            postParams.putString("caption", "yourAppName");
            postParams.putString("description", "yourText");
            postParams.putString("message", "yourComment");
            postParams.putString("link", "yourLink");
            postParams.putString("picture", "yourImagUrl");

            GraphRequest request = new GraphRequest(accessToken, "me/feed",
                    postParams, HttpMethod.POST, null);

            GraphResponse response = request.executeAndWait();//or executeAsync() see documentation


            FacebookRequestError error = response.getError();
            if (error != null) {
                //do something with error
                return;
            }
            //do something with response