Android facebook image uploading?
<p>I have below code to upload photo...        </p>

<pre><code>            byte[] data = null;

            Bundle params = new Bundle();
            Bitmap bitmap = getBitmapFromURL("http://aux.iconpedia.netuploads/250578763.png");
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            bitmap.compress(Bitmap.CompressFormat.JPEG, 100, baos);
            data = baos.toByteArray();

            params.putString("method", "photos.upload");
            params.putByteArray("picture", data);
</code></pre>

<p>Logcat is ::</p>

<pre><code>11-04 22:48:57.535: WARN/Bundle(424): Key picture expected String but value was a [B.  The default value &lt;null&gt; was returned.
11-04 22:48:57.555: WARN/Bundle(424): Attempt to cast generated internal exception:
11-04 22:48:57.555: WARN/Bundle(424): java.lang.ClassCastException: [B
11-04 22:48:57.555: WARN/Bundle(424):     at android.os.Bundle.getString(Bundle.java:1040)
11-04 22:48:57.555: WARN/Bundle(424):     at com.logistics.finalfacebook.Util.encodeUrl(Util.java:85)
11-04 22:48:57.555: WARN/Bundle(424):     at com.logistics.finalfacebook.Facebook.dialog(Facebook.java:622)
11-04 22:48:57.555: WARN/System.err(424): java.lang.NullPointerException
11-04 22:48:57.565: WARN/System.err(424):     at java.net.URLEncoder.encode(URLEncoder.java:53)
11-04 22:48:57.565: WARN/System.err(424):     at com.logistics.finalfacebook.Util.encodeUrl(Util.java:85)
11-04 22:48:57.565: WARN/System.err(424):     at com.logistics.finalfacebook.Facebook.dialog(Facebook.java:622)
11-04 22:48:57.565: WARN/System.err(424):     at com.logistics.finalfacebook.MainActivity$LoginDialogListener.onComplete(MainActivity.java:245)
11-04 22:48:57.565: WARN/System.err(424):     at com.logistics.finalfacebook.Facebook$1.onComplete(Facebook.java:316)
11-04 22:48:57.565: WARN/System.err(424):     at com.logistics.finalfacebook.FbDialog$FbWebViewClient.shouldOverrideUrlLoading(FbDialog.java:134)
</code></pre>
