URLEncoder.encode()在android中有一些问题

时间:2010-10-11 11:37:21

标签: java android

嗨,我正在使用Facebook应用程序,当我发布我的消息,这是完美的帖子但是 但两个单词之间的空格给出'+'符号标志。 例如:: Hello + Good + Morning ....所以任何人都可以告诉我如何解决这个问题,我在等待。

public void postMessage() throws UnsupportedEncodingException
{   
  String posttext = "";     
  posttext = editText.getText().toString().trim();      
  AsyncFacebookRunner mAsyncRunner = new AsyncFacebookRunner(oauth);
  Bundle params = new Bundle();     
  params.putString("access_token", access_token);
  params.putString("message", URLEncoder.encode(posttext,"UTF-8"));     
  mAsyncRunner.request("me/feed", params, "POST", this);
}

1 个答案:

答案 0 :(得分:0)

尝试使用%20而不是空格。