java - Facebook Fetching friends in custom layout -
i trying fetch facebook friends in custom layout. have updates libraries , jar files new fb sdk version.. still facing error.. can please on this.. kind of you.. here placing module of fetching friends
private void showfriendlist() { if (session.getactivesession() != null) { session.openactivesession(invitefriendsactivity.this, true, new statuscallback() { @override public void call(session session, sessionstate state, exception exception) { // todo auto-generated // method stub list<string> permissions = session.getpermissions(); permissions.add("user_friends"); session.newpermissionsrequest request = new session.newpermissionsrequest( getparent(), arrays.aslist("user_friends")); session.requestnewreadpermissions(request); log.v("invite friends request", ">>>>>>>>>>>>>>>request send" + permissions.tostring()); log.v("request's session state", ">>>>>>>>>>>>>>" + session.isopened()); request friendsrequest = createrequest(session); friendsrequest.setcallback(new request.callback() { @override public void oncompleted(response response) { list<graphuser> friends = getresults(response); if (friends != null) { invitebtn.setvisibility(view.visible); log.v("fbbbbbb", "---------------------\n size =" + friends.size()); (int = 0; < friends.size(); i++) { jsonobject data = null; string imgurl = null; try { data = friends .get(i) .getinnerjsonobject() .getjsonobject( "picture"); log.v("jsondata", "data =" + data); jsonobject arrayfriend = data .getjsonobject("data"); log.v("imgurl", "imgurl =" + imgurl); imgurl = arrayfriend .optstring("url"); log.v("imgurl", "imgurl =" + imgurl); } catch (jsonexception e) { e.printstacktrace(); } final frienddatabean fblist = new frienddatabean(); fblist.setid(friends.get(i).getid()); fblist.setname(friends.get(i) .getname()); fblist.setprofilepic(imgurl); log.v("for", "i =" + i); log.v("user", "user " + + ": " + friends.get(i).getname() + "\npath=" + data + "\nimgurl:" + imgurl); fbfriends.add(fblist); } progressdialog.cancel(); adapter = new fbfriendlistadapter( invitefriendsactivity.this, r.layout.invite_friends_list_item, fbfriends); listview.setadapter(adapter); } } }); friendsrequest.executeasync(); } }); } else { progressdialog.cancel(); log.v("tttttt", "no session"); getfacebookdata(); }}
and here logcat..
12-02 01:28:01.044: e/androidruntime(2838): fatal exception: main 12-02 01:28:01.044: e/androidruntime(2838): process: com.clubewinepro.youpin, pid: 2838 12-02 01:28:01.044: e/androidruntime(2838): java.lang.unsupportedoperationexception 12-02 01:28:01.044: e/androidruntime(2838): @ java.util.collections$unmodifiablecollection.add(collections.java:928) 12-02 01:28:01.044: e/androidruntime(2838): @ com.clubewinepro.youpin.invitefriendsactivity$1.call(invitefriendsactivity.java:147) 12-02 01:28:01.044: e/androidruntime(2838): @ com.facebook.session$4$1.run(session.java:1545) 12-02 01:28:01.044: e/androidruntime(2838): @ android.os.handler.handlecallback(handler.java:733) 12-02 01:28:01.044: e/androidruntime(2838): @ android.os.handler.dispatchmessage(handler.java:95) 12-02 01:28:01.044: e/androidruntime(2838): @ android.os.looper.loop(looper.java:136) 12-02 01:28:01.044: e/androidruntime(2838): @ android.app.activitythread.main(activitythread.java:5017) 12-02 01:28:01.044: e/androidruntime(2838): @ java.lang.reflect.method.invokenative(native method) 12-02 01:28:01.044: e/androidruntime(2838): @ java.lang.reflect.method.invoke(method.java:515) 12-02 01:28:01.044: e/androidruntime(2838): @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:779) 12-02 01:28:01.044: e/androidruntime(2838): @ com.android.internal.os.zygoteinit.main(zygoteinit.java:595) 12-02 01:28:01.044: e/androidruntime(2838): @ dalvik.system.nativestart.main(native method)
Comments
Post a Comment