0

hi i am working on facebook app and when i am posting my message which is perfectly post but but space between two word which gives '+' sign sign. eg:: Hello+Good+Morning.... so can any one tell me how to fix this please i am waiting.

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);
}

tim_yates
  • 167,322
  • 27
  • 342
  • 338
  • see this post and choose easiest that suits your needs http://stackoverflow.com/questions/724043/http-url-address-encoding-in-java/4605816#4605816 – fmucar Mar 24 '12 at 22:02

1 Answers1

0

Try putting %20 instead of space.

Mosty Mostacho
  • 42,742
  • 16
  • 96
  • 123
ykatchou
  • 3,667
  • 1
  • 22
  • 27