title: Upload picture / photo/ image facebook (android)
body: <p>I'm using the official Facebook library and I publish photos perfectly.
  But I've a doubt. When you post for first time, the image appears in the message above the wall. But when you post for second time, it doesn't create a new post, the previous post is edited and says "2 pictures added".</p>
  
  <p>If the post is located at the bottom of the wall, and re-post a photo, we will not see any message at the top, will be released in the inner message. This will be as hidden.
  Can you create a new post every time I upload a photo? How is it possible?</p>
  
  <p>I share with you my code works also anyone can help. Thank you.</p>
  
  <h3>OnClick:</h3>
  
  <pre><code>mFacebook = new Facebook(APP_ID);
  mFacebook.authorize(Principal.this, new String[]{ "user_photos,publish_checkins,publish_actions,publish_stream"},new DialogListener() {
  @Override
  public void onComplete(Bundle values) {
      postImageonWall();
       }
   @Override
   public void onFacebookError(FacebookError error) {
       }
   @Override
   public void onError(DialogError e) {
       }
   @Override
   public void onCancel() {
       }
    });
  </code></pre>
  
  <h3>PostWall:</h3>
  
  <pre><code>public void postImageonWall() {
  
          byte[] data = null;
  
            Bitmap bi = BitmapFactory.decodeFile(fotomontatgeInSD);
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            bi.compress(Bitmap.CompressFormat.JPEG, 100, baos);
            data = baos.toByteArray();
  
  
            Bundle params = new Bundle();
            params.putString(Facebook.TOKEN, mFacebook.getAccessToken());
            params.putString("method", "photos.upload");
            params.putByteArray("picture", data);
  
            AsyncFacebookRunner mAsyncRunner = new AsyncFacebookRunner(mFacebook);
            mAsyncRunner.request(null, params, "POST", new SampleUploadListener(), null);
   }
  
  
  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."
  
       } catch (JSONException e) {
           Log.w("Facebook-Example", "JSON Error in response");
       } catch (FacebookError e) {
           Log.w("Facebook-Example", "Facebook Error: " + e.getMessage());
       }
   }
  
   @Override
   public void onFacebookError(FacebookError e, Object state) {
       // TODO Auto-generated method stub
  
   }
  }
  </code></pre>
  
  <p><strong>I just discovered that the new facebook design solves this problem.</strong></p>