Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8637627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:31:28+00:00 2026-06-12T10:31:28+00:00

I am trying to upload one image on facebook wall from drawable folder of

  • 0

I am trying to upload one image on facebook wall from drawable folder of my android project. But I am failed … the message is showing on the wall but image is not on wall ..
my sample code is given below ..

    Drawable drawable =  ClassName.this.getResources().getDrawable(R.drawable.ic_launcher);
        Bitmap bitmap = (Bitmap)((BitmapDrawable) drawable).getBitmap();
        ByteArrayOutputStream stream = new ByteArrayOutputStream();
        bitmap.compress(Bitmap.CompressFormat.JPEG, 100, stream);
        byte[] bitMapData = stream.toByteArray();


        Bundle params = new Bundle();

        params.putString("message", "Tarun Kumar");
        params.putString("name", "MY Image");
        params.putByteArray("picture", bitMapData);
        mAsyncFbRunner.request("me/feed", params, "POST", new WallPostListener());

It is showing some error on Log.. like

10-03 12:55:55.664: W/Bundle(529): Key message expected byte[] but value was a   java.lang.String.  The default value <null> was returned.
10-03 12:55:55.914: D/dalvikvm(529): GC_FOR_MALLOC freed 6599 objects / 465168 bytes in   225ms
10-03 12:55:55.924: W/Bundle(529): Attempt to cast generated internal exception:
10-03 12:55:55.924: W/Bundle(529): java.lang.ClassCastException: java.lang.String
10-03 12:55:55.924: W/Bundle(529):  at android.os.Bundle.getByteArray(Bundle.java:1305)
10-03 12:55:55.924: W/Bundle(529):  at com.facebook.android.Util.openUrl(Util.java:155)
10-03 12:55:55.924: W/Bundle(529):  at   com.facebook.android.Facebook.request(Facebook.java:559)
10-03 12:55:55.924: W/Bundle(529):  at  com.facebook.android.AsyncFacebookRunner$2.run(AsyncFacebookRunner.java:208)
10-03 12:55:55.924: W/Bundle(529): Key format expected byte[] but value was a  java.lang.String.  The default value <null> was returned.
10-03 12:55:55.924: W/Bundle(529): Attempt to cast generated internal exception:
10-03 12:55:55.924: W/Bundle(529): java.lang.ClassCastException: java.lang.String
10-03 12:55:55.924: W/Bundle(529):  at android.os.Bundle.getByteArray(Bundle.java:1305)
10-03 12:55:55.924: W/Bundle(529):  at com.facebook.android.Util.openUrl(Util.java:155)
10-03 12:55:55.924: W/Bundle(529):  at com.facebook.android.Facebook.request(Facebook.java:559)
10-03 12:55:55.924: W/Bundle(529):  at com.facebook.android.AsyncFacebookRunner$2.run(AsyncFacebookRunner.java:208)
10-03 12:55:55.984: W/Bundle(529): Key access_token expected byte[] but value was a  java.lang.String.  The default value <null> was returned.
10-03 12:55:55.984: W/Bundle(529): Attempt to cast generated internal exception:  
10-03 12:55:55.984: W/Bundle(529): java.lang.ClassCastException: java.lang.String
10-03 12:55:55.984: W/Bundle(529):  at android.os.Bundle.getByteArray(Bundle.java:1305)
10-03 12:55:55.984: W/Bundle(529):  at com.facebook.android.Util.openUrl(Util.java:155)
10-03 12:55:55.984: W/Bundle(529):  at com.facebook.android.Facebook.request(Facebook.java:559)
10-03 12:55:55.984: W/Bundle(529):  at com.facebook.android.AsyncFacebookRunner$2.run(AsyncFacebookRunner.java:208)
10-03 12:55:55.984: D/webviewglue(529): nativeDestroy view: 0x27a548
10-03 12:55:56.014: W/Bundle(529): Key name expected byte[] but value was a java.lang.String.  The default value <null> was returned.
10-03 12:55:56.014: W/Bundle(529): Attempt to cast generated internal exception:
10-03 12:55:56.014: W/Bundle(529): java.lang.ClassCastException: java.lang.String
10-03 12:55:56.014: W/Bundle(529):  at android.os.Bundle.getByteArray(Bundle.java:1305)
10-03 12:55:56.014: W/Bundle(529):  at com.facebook.android.Util.openUrl(Util.java:155)
10-03 12:55:56.014: W/Bundle(529):  at com.facebook.android.Facebook.request(Facebook.java:559)
10-03 12:55:56.014: W/Bundle(529):  at  com.facebook.android.AsyncFacebookRunner$2.run(AsyncFacebookRunner.java:208)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T10:31:30+00:00Added an answer on June 12, 2026 at 10:31 am

    In case of posting image from app to fb you can’t use me/feed parameter , you have to use photos and request will be

    mAsyncFbRunner.request("photos", parameters, 
                                        "POST", new WallPostListener());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently trying to upload an image from my Mac application to Facebook. To
I am trying to upload image file from my one server to another remote
I'm trying to resize one image to 5 different sizes (and then upload them
I'm trying to upload several files at once from ONE input : <input type=file
I am trying to upload a file from browser, then make one thumbnail from
I am trying to upload an image using django and following a tutorial from
Trying to resample one image and upload(reupload) it to my server via ftp. I've
please check my code: Here i'm trying to upload screenshot to facebook album, but
I am trying to upload an image to Amazon S3 but before that I
I'm trying to upload images to a php file, everything works, but sometimes when

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.