android - Integration with facebook for each activity -
i working on recipes app , have 2 questions:
i have 50 activities, 1 each recipe. either have write code on each activity sharing on facebook or on main activity.
i want when click on share button recipe post on facebook when click on share button goes on simple post option posting status or image.
here code sharing:
@override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_beef_r1); button b1=(button)findviewbyid(r.id.button); b1.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { intent sharingintent = new intent(intent.action_send); uri screenshoturi = uri.parse("android.resource://comexample.sairamkrishna.myapplication/*"); try { inputstream stream = getcontentresolver().openinputstream(screenshoturi); } catch (filenotfoundexception e) { // todo auto-generated catch block e.printstacktrace(); } sharingintent.settype("image/jpeg"); sharingintent.putextra(intent.extra_stream, screenshoturi); startactivity(intent.createchooser(sharingintent, "share image using")); } }); }
Comments
Post a Comment