title: Predefined text directly posted on facebook wall
body: <p>i am using facebook android sdk provided for facebook i m using their examples-simple provided by them and its working very finely , now on login in fb show a form from fb to post on wall on button click .
  but I want to set text directly from code and on button click it directly post the text set by me on fb without calling the wall post form to enter the text and share .  </p>
  
  <p><img src="https://i.stack.imgur.com/4sK3F.png" alt="this is my project image conatning all fb related files that i m using "></p>
  
  <p>this is my project image conatning all fb related files that i m using and beloow is mu step wise o/p of this project</p>
  
  <p>1.login</p>
  
  <p><img src="https://i.stack.imgur.com/LdPk3.png" alt="enter image description here"></p>
  
  <p><img src="https://i.stack.imgur.com/oSm2x.png" alt="enter image description here"></p>
  
  <p>after clcik show share form</p>
  
  <p><img src="https://i.stack.imgur.com/rtpnx.png" alt="enter image description here"></p>
  
  <p>but after wall post i want to directly upload my post on fb how can i do this  and what to change i am not getting any idea i tried but cannot set my predefined text ,how cani directly post on wall without calling the form to share 
  i have downloaded sdk fron gitstore from this link <a href="https://github.com/facebook/facebook-android-sdk/" rel="nofollow noreferrer">https://github.com/facebook/facebook-android-sdk/</a>  pls help me thanks in advance</p>
  
  <p>this is my example.java code </p>
  
  <pre><code>      mUploadButton.setOnClickListener(new OnClickListener() {
              public void onClick(View v) {
                  Bundle params = new Bundle();
                  params.putString("method", "photos.upload");
  
                  URL uploadFileUrl = null;
                  try {
                      uploadFileUrl = new URL(
                          "http://www.facebook.com/images/devsite/iphone_connect_btn.jpg");
                  } catch (MalformedURLException e) {
                      e.printStackTrace();
                  }
                  try {
                      HttpURLConnection conn= (HttpURLConnection)uploadFileUrl.openConnection();
                      conn.setDoInput(true);
                      conn.connect();
                      int length = conn.getContentLength();
  
                      byte[] imgData =new byte[length];
                      InputStream is = conn.getInputStream();
                      is.read(imgData);
                      params.putByteArray("picture", imgData);
  
                  } catch  (IOException e) {
                      e.printStackTrace();
                  }
  
                  mAsyncRunner.request(null, params, "POST",
                          new SampleUploadListener(), null);
              }
          });
          mUploadButton.setVisibility(mFacebook.isSessionValid() ?
                  View.VISIBLE :
                  View.INVISIBLE);
  
          mPostButton.setOnClickListener(new OnClickListener() {
              public void onClick(View v) {
                  mFacebook.dialog(Example.this, "feed",
                          new SampleDialogListener());
              }
          });
          mPostButton.setVisibility(mFacebook.isSessionValid() ?
                  View.VISIBLE :
                  View.INVISIBLE);
      }
  
      @Override
      protected void onActivityResult(int requestCode, int resultCode,
                                      Intent data) {
          mFacebook.authorizeCallback(requestCode, resultCode, data);
      }
  
      public class SampleAuthListener implements AuthListener {
  
          public void onAuthSucceed() {
              mText.setText("You have logged in! ");
              mRequestButton.setVisibility(View.VISIBLE);
              mUploadButton.setVisibility(View.VISIBLE);
              mPostButton.setVisibility(View.VISIBLE);
          }
  
          public void onAuthFail(String error) {
              mText.setText("Login Failed: " + error);
          }
      }
  
      public class SampleLogoutListener implements LogoutListener {
          public void onLogoutBegin() {
              mText.setText("Logging out...");
          }
  
          public void onLogoutFinish() {
              mText.setText("You have logged out! ");
              mRequestButton.setVisibility(View.INVISIBLE);
              mUploadButton.setVisibility(View.INVISIBLE);
              mPostButton.setVisibility(View.INVISIBLE);
          }
      }
  
      public class SampleRequestListener extends BaseRequestListener {
  
          public void onComplete(final String response, final Object state) {
              try {
                  // process the response here: executed in background thread
                  Log.d("Facebook-Example", "Response: " + response.toString());
                  JSONObject json = Util.parseJson(response);
                  final String name = json.getString("name");
  
                  // then post the processed result back to the UI thread
                  // if we do not do this, an runtime exception will be generated
                  // e.g. "CalledFromWrongThreadException: Only the original
                  // thread that created a view hierarchy can touch its views."
                  Example.this.runOnUiThread(new Runnable() {
                      public void run() {
                          mText.setText("Hello there, " + name + "!");
                      }
                  });
              } catch (JSONException e) {
                  Log.w("Facebook-Example", "JSON Error in response");
              } catch (FacebookError e) {
                  Log.w("Facebook-Example", "Facebook Error: " + e.getMessage());
              }
          }
      }
  
      public class SampleUploadListener extends BaseRequestListener {
  
          public void onComplete(final String response, final Object state) {
              try {
                  // process the response here: (executed in background thread)
                  Log.d("Facebook-Example", "Response: " + response.toString());
                  JSONObject json = Util.parseJson(response);
                  final String src = json.getString("src");
  
                  // then post the processed result back to the UI thread
                  // if we do not do this, an runtime exception will be generated
                  // e.g. "CalledFromWrongThreadException: Only the original
                  // thread that created a view hierarchy can touch its views."
                  Example.this.runOnUiThread(new Runnable() {
                      public void run() {
                          mText.setText("Hello there, photo has been uploaded at \n" + src);
                      }
                  });
              } catch (JSONException e) {
                  Log.w("Facebook-Example", "JSON Error in response");
              } catch (FacebookError e) {
                  Log.w("Facebook-Example", "Facebook Error: " + e.getMessage());
              }
          }
      }
      public class WallPostRequestListener extends BaseRequestListener {
  
          public void onComplete(final String response, final Object state) {
              Log.d("Facebook-Example", "Got response: " + response);
              String message = "&lt;empty&gt;";
              try {
  
                  JSONObject json = Util.parseJson(response);
                  message = json.getString("lithe Technologies");
              } catch (JSONException e) {
                  Log.w("Facebook-Example", "JSON Error in response");
              } catch (FacebookError e) {
                  Log.w("Facebook-Example", "Facebook Error: " + e.getMessage());
              }
              final String text = "Your Wall Post: " + message + "helloooo lithe";
              Example.this.runOnUiThread(new Runnable() {
                  public void run() {
                      mText.setText(text);
                  }
              });
          }
      }
  
      public class WallPostDeleteListener extends BaseRequestListener {
  
          public void onComplete(final String response, final Object state) {
              if (response.equals("true")) {
                  Log.d("Facebook-Example", "Successfully deleted wall post");
                  Example.this.runOnUiThread(new Runnable() {
                      public void run() {
                          mDeleteButton.setVisibility(View.INVISIBLE);
                          mText.setText("Deleted Wall Post");
                      }
                  });
              } else {
                  Log.d("Facebook-Example", "Could not delete wall post");
              }
          }
      }
  
  
      public class SampleDialogListener extends BaseDialogListener {
  
          public void onComplete(Bundle values) {
              final String postId = values.getString("post_id");
              if (postId != null) {
                  Log.d("Facebook-Example", "Dialog Success! post_id=" + postId);
                  mAsyncRunner.request(postId, new WallPostRequestListener());
                  mDeleteButton.setOnClickListener(new OnClickListener() {
                      public void onClick(View v) {
                          mAsyncRunner.request(postId, new Bundle(), "DELETE",
                                  new WallPostDeleteListener(), null);
                      }
                  });
                  mDeleteButton.setVisibility(View.VISIBLE);
              } else {
                  Log.d("Facebook-Example", "No wall post made");
              }
          }
      }
  
  }
  </code></pre>