我正在尝试在 facebook 上发帖,所以我正在使用以下代码。它运作良好,但我似乎无法发布简单的确认祝酒词。
private class FacebookPoster extends AsyncTask<String, Object, Object>
{
@Override
protected Object doInBackground(String... message)
{
Bundle parameters = new Bundle();
parameters.putString("message", message[0]);
parameters.putString("description", "topic share");
parameters.putString("link", ctx.getResources().getString(R.string.rateLink));
parameters.putString("picture", ctx.getResources().getString(R.string.linkIconPicture));
Log.d("ERRRR", "set params");
try
{
facebook.request("me");
String response = facebook.request("me/feed", parameters, "POST");
Log.d("Tests", "got response: " + response);
if (response == null || response.equals("") || response.equals("false"))
{
return "Blank response.";
}
else
{
return "Message posted to your facebook wall!";
}
}
catch (Exception e)
{
return "Failed to post to wall!";
}
}
@Override
protected void onProgressUpdate(Object... values)
{
// TODO Auto-generated method stub
super.onProgressUpdate(values);
showToast(values);
}
}
showToast 函数
private void showToast(Object message)
{
Toast.makeText(ctx, message.toString(), Toast.LENGTH_SHORT).show();
}
我认为 onProgressUpdate 没有被调用。请帮忙。