http://www.vogella.com/articles/AndroidNetworking/article.html
Read this blog..!! You will also get to understand about STRICT MODE.. On Sat, Oct 6, 2012 at 12:09 PM, lokesh gupta <lokeshgupt...@gmail.com>wrote: > Put the network call innew thread.. U cant make network call in main thread > On Oct 6, 2012 12:04 PM, "Dilip Kumar Chaudhary" <androiddili...@gmail.com> > wrote: > >> Hi all, >> I'm using Android facebook SDK for post on facebook wall.I have used >> following code for wall post but every time through exception * >> android.os.NetworkOnMainThreadException* >> public void postToWall(String message) { >> Bundle parameters = new Bundle(); >> parameters.putString("message", message); >> parameters.putString("description", "topic share"); >> try { >> facebook.request("me"); >> String response = facebook.request("me/feed", parameters, >> "POST"); >> Log.d("Tests", "got response: " + response); >> if (response == null || response.equals("") >> || response.equals("false")) { >> showToast("Blank response."); >> } else { >> showToast("Message posted to your facebook wall!"); >> } >> finish(); >> } catch (Exception e) { >> showToast("Failed to post to wall!"); >> e.printStackTrace(); >> finish(); >> } >> } >> >> -- >> *Thanks & Regards* >> Dilip Kumar Chaudhary >> My Linkedin >> Profile<http://in.linkedin.com/pub/dilip-kumar-chaudhary/44/64/55b> >> My Development Blog <http://dilipdevelopment.blogspot.com/> >> >> -- >> You received this message because you are subscribed to the Google >> Groups "Android Developers" group. >> To post to this group, send email to android-developers@googlegroups.com >> To unsubscribe from this group, send email to >> android-developers+unsubscr...@googlegroups.com >> For more options, visit this group at >> http://groups.google.com/group/android-developers?hl=en > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to android-developers@googlegroups.com > To unsubscribe from this group, send email to > android-developers+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- live and let LIVE!!! -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en