title: android facebook publish photo
body: <p>After looking on the net for 2 days I finally decided to post on SO.</p>
  
  <p>Well I simply want to publish a photo in my android app on to facebook.</p>
  
  <p>AM using the official android-facebook-sdk. I imported to example project and in the upload section add my code to upload photo. like</p>
  
  <pre><code>mUploadButton.setOnClickListener(new OnClickListener() {
      public void onClick(View v) {
          Bundle params = new Bundle();
          params.putString("method", "photos.upload");
  
          Bitmap temp = BitmapFactory.decodeResource(getResources(),R.drawable.facebook_icon);
          ByteArrayOutputStream baos = new ByteArrayOutputStream();
          temp.compress(Bitmap.CompressFormat.JPEG, 100, baos);
          byte[] imgData = baos.toByteArray();
  
          params.putByteArray("picture", imgData);
          mAsyncRunner.request(null, params, "POST", new SampleUploadListener());
      }
  });
  </code></pre>
  
  <p>But it doent work :(</p>
  
  <p>I went through the links in this forum too like:
  <a href="https://stackoverflow.com/questions/3323496/looking-for-android-facebook-sdk-examples">Looking for android Facebook SDK examples</a></p>
  
  <p>but am not able to post. :(</p>
  
  <p>Kindly help me.THanks.</p>