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
  • 161,005
  • 26
  • 328
  • 327
  • 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
  • 41,294
  • 14
  • 93
  • 121
ykatchou
  • 3,647
  • 1
  • 21
  • 26