Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/tfs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何在Facebook墙上显示默认文本?_Android_Facebook_Android Intent - Fatal编程技术网

Android 如何在Facebook墙上显示默认文本?

Android 如何在Facebook墙上显示默认文本?,android,facebook,android-intent,Android,Facebook,Android Intent,我正在开发一个应用程序。在其中,我显示了所有默认的共享选项,如蓝牙、电子邮件、硬盘、Facebook、Twitter、Yahoo、FreeMS。我在中得到默认文本,除了Facebook。如何在Facebook墙上设置默认文本。请帮我解决这个问题 我的代码如下: public class MainActivity extends Activity implements OnClickListener { private Button btn_share; // private Dialog md

我正在开发一个应用程序。在其中,我显示了所有默认的共享选项,如蓝牙、电子邮件、硬盘、Facebook、Twitter、Yahoo、FreeMS。我在
中得到默认文本,除了Facebook
。如何在Facebook墙上设置默认文本。请帮我解决这个问题

我的代码如下:

public class MainActivity extends Activity implements OnClickListener {

private Button btn_share;
// private Dialog mdialog = null;
private String TAG = "This Message is from HardenUp.Thank You.";

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    setContentView(R.layout.activity_main);

    getInit();
}

private void getInit() {
    btn_share = (Button) findViewById(R.id.btn_share);
    btn_share.setOnClickListener(this);
}

public void onClick(View v) {
    if (v == btn_share) {
        // showDialog();

        Intent sharingIntent = new Intent(
                android.content.Intent.ACTION_SEND);

        sharingIntent.setType("text/plain");
        sharingIntent.putExtra(Intent.EXTRA_TEXT, TAG);
        sharingIntent.putExtra(Intent.EXTRA_SUBJECT, "HardenUp");
        startActivity(Intent.createChooser(sharingIntent, "Share Using"));
    }

}

}

为此,我必须添加Facebook API。我不希望这样。通过ACTION_SEND,我可以打开默认的Facebook。但问题是默认文本没有显示在Facebook墙上。我在Twitter、电子邮件和免费短信上获得了文本。如何在Facebook墙上显示默认消息。
public void postOnWall(String msg) {
        Log.d("Tests", "Testing graph API wall post");
         try {
                String response = mFacebook.request("me");
                Bundle parameters = new Bundle();
                //Here what you want to pass message
                parameters.putString("message", msg);
                //Here what you want to pass message
                parameters.putString("description", "test test test");
                response = mFacebook.request("me/feed", parameters, 
                        "POST");
                Log.d("Tests", "got response: " + response);
                if (response == null || response.equals("") || 
                        response.equals("false")) {
                   Log.v("Error", "Blank response");
                }
         } catch(Exception e) {
             e.printStackTrace();
         }
    }