Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/202.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 - Fatal编程技术网

从Android应用程序在Facebook上发布分数

从Android应用程序在Facebook上发布分数,android,Android,我正在使用以下代码。当我选择twitter应用程序时,它会在推特对话框中显示“我的分数是2000”文本,但在Facebook帖子对话框中不会显示文本 Intent shareIntent=new Intent(Intent.ACTION_SEND); shareIntent.setType("text/plain"); shareIntent.putExtra(Intent.EXTRA_TEXT,"My score is with snake game is 2000"); shareInten

我正在使用以下代码。当我选择twitter应用程序时,它会在推特对话框中显示“我的分数是2000”文本,但在Facebook帖子对话框中不会显示文本

Intent shareIntent=new Intent(Intent.ACTION_SEND);
shareIntent.setType("text/plain");
shareIntent.putExtra(Intent.EXTRA_TEXT,"My score is with snake game is 2000");
shareIntent.putExtra(Intent.EXTRA_SUBJECT, "The title");
startActivity(Intent.createChooser(shareIntent, "Share..."));

您的代码是正确的,但fb android应用程序没有(正确地)实现API。我找到的唯一解决方案是使用fb android sdk(com.facebook.android):


Facebook不允许您为用户设置消息。这是一个众所周知的问题,以前曾多次被问及。Facebook已经开始允许你预先填充信息(至少在iOS 6+原生FB共享中)。也许这会在将来被打开

    Bundle parameters = new Bundle();
    parameters.putString("caption", "The title");
    parameters.putString("description", "My score is with snake game is 2000");
    facebook.dialog(this, "feed", parameters, this);