facebook - How to Update status in Social Auth share Android -
i using social auth social network integration integrating facebook, twitter , linkedin. update status post in social network sites programicaly hardcoded.
as new android programming, help me........
i need code update status feature....for ex. when click on facebook , should inquire me status update, , post message in respective social network
my code follows
bundle org.brickred.socialbar; import org.brickred.socialauth.android.dialoglistener; import org.brickred.socialauth.android.socialautherror; import org.brickred.socialauth.android.socialauthadapter; import org.brickred.socialauth.android.socialauthadapter.provider; import android.app.activity; import android.os.bundle; import android.util.log; import android.widget.linearlayout; import android.widget.textview; import android.widget.toast; public class sharebaractivity extends activity { // socialauth component socialauthadapter adapter; boolean status; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); linearlayout bar = (linearlayout)findviewbyid(r.id.linearbar); // add together bar library adapter = new socialauthadapter(new responselistener()); // add together providers adapter.addprovider(provider.facebook, r.drawable.facebook); adapter.addprovider(provider.twitter, r.drawable.twitter); adapter.addprovider(provider.linkedin, r.drawable.linkedin); adapter.enable(bar); // set size of dialog adapter.setdialogsize(30,60); } /** * listens response library * */ private final class responselistener implements dialoglistener { public void oncomplete(bundle values) { // variable receive message status log.d("sharebar" , "authentication successful"); // name of provider after authentication string providername = values.getstring(socialauthadapter.provider); log.d("sharebar", "provider name = " + providername); // please avoid sending duplicate message. social media providers block duplicate messages. adapter.updatestatus("test api"); toast.maketext(sharebaractivity.this, "message posted on " + providername, toast.length_short).show(); } public void onerror(socialautherror error) { error.printstacktrace(); log.d("sharebar" , error.getmessage()); } public void oncancel() { log.d("sharebar" , "authentication cancelled"); } }
}
android facebook twitter share linkedin
No comments:
Post a Comment