Getting exception on android facebook code -


getting exception in android facebook code on util class on line 215 here print stack:

04-05 11:08:34.015: e/androidruntime(13527): fatal exception: main 04-05 11:08:34.015: e/androidruntime(13527): android.os.networkonmainthreadexception 04-05 11:08:34.015: e/androidruntime(13527):    @ android.os.strictmode$androidblockguardpolicy.onnetwork(strictmode.java:1117) 04-05 11:08:34.015: e/androidruntime(13527):    @ java.net.inetaddress.lookuphostbyname(inetaddress.java:385) 04-05 11:08:34.015: e/androidruntime(13527):    @ java.net.inetaddress.getallbynameimpl(inetaddress.java:236) 04-05 11:08:34.015: e/androidruntime(13527):    @ java.net.inetaddress.getallbyname(inetaddress.java:214) 04-05 11:08:34.015: e/androidruntime(13527):    @ libcore.net.http.httpconnection.<init>(httpconnection.java:70) 04-05 11:08:34.015: e/androidruntime(13527):    @ libcore.net.http.httpconnection.<init>(httpconnection.java:50) 04-05 11:08:34.015: e/androidruntime(13527):    @ libcore.net.http.httpconnection$address.connect(httpconnection.java:341) 04-05 11:08:34.015: e/androidruntime(13527):    @ libcore.net.http.httpconnectionpool.get(httpconnectionpool.java:87) 04-05 11:08:34.015: e/androidruntime(13527):    @ libcore.net.http.httpconnection.connect(httpconnection.java:128) 04-05 11:08:34.015: e/androidruntime(13527):    @ libcore.net.http.httpengine.opensocketconnection(httpengine.java:315) 04-05 11:08:34.015: e/androidruntime(13527):    @ libcore.net.http.httpsurlconnectionimpl$httpsengine.makesslconnection(httpsurlconnectionimpl.java:461) 04-05 11:08:34.015: e/androidruntime(13527):    @ libcore.net.http.httpsurlconnectionimpl$httpsengine.connect(httpsurlconnectionimpl.java:433) 04-05 11:08:34.015: e/androidruntime(13527):    @ libcore.net.http.httpengine.sendsocketrequest(httpengine.java:289) 04-05 11:08:34.015: e/androidruntime(13527):    @ libcore.net.http.httpengine.sendrequest(httpengine.java:239) 04-05 11:08:34.015: e/androidruntime(13527):    @ libcore.net.http.httpurlconnectionimpl.getresponse(httpurlconnectionimpl.java:273) 04-05 11:08:34.015: e/androidruntime(13527):    @ libcore.net.http.httpurlconnectionimpl.getinputstream(httpurlconnectionimpl.java:168) 04-05 11:08:34.015: e/androidruntime(13527):    @ libcore.net.http.httpsurlconnectionimpl.getinputstream(httpsurlconnectionimpl.java:271) 04-05 11:08:34.015: e/androidruntime(13527):    @ com.facebook.android.util.openurl(util.java:215) 04-05 11:08:34.015: e/androidruntime(13527):    @ com.facebook.android.facebook.request(facebook.java:755) 04-05 11:08:34.015: e/androidruntime(13527):    @ com.facebook.android.facebook.request(facebook.java:692) 04-05 11:08:34.015: e/androidruntime(13527):    @ com.agequiz.fbhelper.facebookconnector$1.onauthsucceed(facebookconnector.java:184) 04-05 11:08:34.015: e/androidruntime(13527):    @ com.agequiz.fbhelper.sessionevents.onloginsuccess(sessionevents.java:78) 04-05 11:08:34.015: e/androidruntime(13527):    @ com.agequiz.fbhelper.facebookconnector$logindialoglistener.oncomplete(facebookconnector.java:112) 04-05 11:08:34.015: e/androidruntime(13527):    @ com.facebook.android.facebook$1.oncomplete(facebook.java:358) 04-05 11:08:34.015: e/androidruntime(13527):    @ com.facebook.android.fbdialog$fbwebviewclient.shouldoverrideurlloading(fbdialog.java:154) 04-05 11:08:34.015: e/androidruntime(13527):    @ android.webkit.callbackproxy.uioverrideurlloading(callbackproxy.java:274) 04-05 11:08:34.015: e/androidruntime(13527):    @ android.webkit.callbackproxy.handlemessage(callbackproxy.java:376) 04-05 11:08:34.015: e/androidruntime(13527):    @ android.os.handler.dispatchmessage(handler.java:99) 04-05 11:08:34.015: e/androidruntime(13527):    @ android.os.looper.loop(looper.java:137) 04-05 11:08:34.015: e/androidruntime(13527):    @ android.app.activitythread.main(activitythread.java:4745) 04-05 11:08:34.015: e/androidruntime(13527):    @ java.lang.reflect.method.invokenative(native method) 04-05 11:08:34.015: e/androidruntime(13527):    @ java.lang.reflect.method.invoke(method.java:511) 04-05 11:08:34.015: e/androidruntime(13527):    @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:786) 04-05 11:08:34.015: e/androidruntime(13527):    @ com.android.internal.os.zygoteinit.main(zygoteinit.java:553) 04-05 11:08:34.015: e/androidruntime(13527):    @ dalvik.system.nativestart.main(native method) 

this exception thrown when application attempts perform networking operation on main thread. run code in asynctask:

private class retreive extends asynctask<void, void, void> {  protected void doinbackground(void... urls) {            return null;          } 

Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -