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 8060421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T09:59:13+00:00 2026-06-05T09:59:13+00:00

I am trying to post on users wall from my application without showing the

  • 0

I am trying to post on users wall from my application without showing the feed dialog box. I have an activity with an EditText getmessage and a Button with onClick()=postToWall. I am following this question:
Android Facebook Post On Wall Without Dialog Warnings

Here is my code:

public void postToWall(View v){
        String message = getmessage.getText().toString();
        postMessage(message);       
    }

    public void postMessage(String message){
        Log.d("test", "testing post to wall");
        try{
            String response;
            Bundle parameters = new Bundle();
            parameters.putString("message", message);           
            response = facebook.request("me/feed", parameters, "POST");

            Log.d("test", "got response "+response);

            if(response == null || response.equals("")){
                Log.v("Error", "Blank");
            }
        }
        catch(Exception e){
            e.printStackTrace();
        }
    }

Below is the log:

  06-06 20:03:19.726: I/ActivityManager(78): Displayed com.MyApp/.fbShare: +146ms
06-06 20:03:24.816: D/test(736): testing post to wall
06-06 20:03:24.828: W/System.err(736): android.os.NetworkOnMainThreadException
06-06 20:03:24.836: W/System.err(736):  at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1099)
06-06 20:03:24.836: W/System.err(736):  at java.net.InetAddress.lookupHostByName(InetAddress.java:391)
06-06 20:03:24.846: W/System.err(736):  at java.net.InetAddress.getAllByNameImpl(InetAddress.java:242)
06-06 20:03:24.846: W/System.err(736):  at java.net.InetAddress.getAllByName(InetAddress.java:220)
06-06 20:03:24.846: W/System.err(736):  at libcore.net.http.HttpConnection.<init>(HttpConnection.java:71)
06-06 20:03:24.846: W/System.err(736):  at libcore.net.http.HttpConnection.<init>(HttpConnection.java:50)
06-06 20:03:24.846: W/System.err(736):  at libcore.net.http.HttpConnection$Address.connect(HttpConnection.java:351)
06-06 20:03:24.846: W/System.err(736):  at libcore.net.http.HttpConnectionPool.get(HttpConnectionPool.java:86)
06-06 20:03:24.846: W/System.err(736):  at libcore.net.http.HttpConnection.connect(HttpConnection.java:128)
06-06 20:03:24.846: W/System.err(736):  at libcore.net.http.HttpEngine.openSocketConnection(HttpEngine.java:308)
06-06 20:03:24.846: W/System.err(736):  at libcore.net.http.HttpsURLConnectionImpl$HttpsEngine.makeSslConnection(HttpsURLConnectionImpl.java:460)
06-06 20:03:24.846: W/System.err(736):  at libcore.net.http.HttpsURLConnectionImpl$HttpsEngine.connect(HttpsURLConnectionImpl.java:432)
06-06 20:03:24.846: W/System.err(736):  at libcore.net.http.HttpEngine.sendSocketRequest(HttpEngine.java:282)
06-06 20:03:24.856: W/System.err(736):  at libcore.net.http.HttpEngine.sendRequest(HttpEngine.java:232)
06-06 20:03:24.856: W/System.err(736):  at libcore.net.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:80)
06-06 20:03:24.856: W/System.err(736):  at libcore.net.http.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:164)
06-06 20:03:24.856: W/System.err(736):  at com.facebook.android.Util.openUrl(Util.java:193)
06-06 20:03:24.866: W/System.err(736):  at com.facebook.android.Facebook.request(Facebook.java:751)
06-06 20:03:24.866: W/System.err(736):  at com.MyApp.fbShare.postMessage(fbShare.java:56)
06-06 20:03:24.866: W/System.err(736):  at com.MyApp.fbShare.postToWall(fbShare.java:47)
06-06 20:03:24.866: W/System.err(736):  at java.lang.reflect.Method.invokeNative(Native Method)
06-06 20:03:24.866: W/System.err(736):  at java.lang.reflect.Method.invoke(Method.java:511)
06-06 20:03:24.876: W/System.err(736):  at android.view.View$1.onClick(View.java:3039)
06-06 20:03:24.876: W/System.err(736):  at android.view.View.performClick(View.java:3511)
06-06 20:03:24.876: W/System.err(736):  at android.view.View$PerformClick.run(View.java:14105)
06-06 20:03:24.876: W/System.err(736):  at android.os.Handler.handleCallback(Handler.java:605)
06-06 20:03:24.886: W/System.err(736):  at android.os.Handler.dispatchMessage(Handler.java:92)
06-06 20:03:24.886: W/System.err(736):  at android.os.Looper.loop(Looper.java:137)
06-06 20:03:24.886: W/System.err(736):  at android.app.ActivityThread.main(ActivityThread.java:4424)
06-06 20:03:24.886: W/System.err(736):  at java.lang.reflect.Method.invokeNative(Native Method)
06-06 20:03:24.896: W/System.err(736):  at java.lang.reflect.Method.invoke(Method.java:511)
06-06 20:03:24.896: W/System.err(736):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
06-06 20:03:24.896: W/System.err(736):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
06-06 20:03:24.896: W/System.err(736):  at dalvik.system.NativeStart.main(Native Method)

Am I missing something here? I am grateful for any help.
Thanks!

  • 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-05T09:59:15+00:00Added an answer on June 5, 2026 at 9:59 am

    Starting with 3.0 (I think) the system throws an exception if you attempt to use the network on the Main (UI) thread. They chose to make the system do this to encourage developers not to put long running tasks (such as network operations) on the Main thread.

    In order to fix your problem you need to move your network operations(e.g. calls to postMessage()) to a background thread. There are a few approaches. Check out AsyncTask or look into using Handler / Thread. Many examples can be found online if you search for something like “Android create background threads”

    Also this tutorial made by Lars Vogel is awesome for learning about this stuff.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to show a 'Post to Your Wall' feed dialog with the
I am trying to post a message to the users wall using a application
I'm trying to post to the active users wall with a mp3 attachment. It
I'm trying to post a message to the users wall in out iOS app.
I am trying to post a message to the users wall using the official
on my site right now I'm trying to have it post to a users
i'm trying to post an image to my users's facebook wall once they hit
I am trying to post a message to a user's feed (wall). I've already
I am trying to post text from my iPhone app to my wall on
I'm trying to show wall posts that all users have made on a specific

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.