How to Share Our Own Static Status in Facebook using Android -
I am developing an application.
When I click on the Twitter button, as I want to share, the Auto button is pressed
/ strong> but I have information in Facebook Can not share as if I want to show in the blank text box of the facebook share status window. Where is me wrong, please tell me? This is my code. I am using the SocietyAuth Library for that. The new version is working for Facebook, only one thing is needed to use
last string msg = "hay -" + "message to share"; @ Override Protected Zero (InstanceStatus saved from Bundle) {..................... ............... .... .. Fixed SocialAuthAdapter adapter; Adapter = new social euthapetter (new response lister); {Adapter.addConfig (Provider T. Witter, "Key", "BSI4LH5Y4SAMBM .............", tap); } Hold (exception e) {e.printStackTrace (); } Imgtellfriend.setOnClickListener (new OnClickListener () {@Override public click on zero (see ARG0) {anim = AnimationUtils.loadAnimation (getApplicationContext (), R.anim.sequence); imgtellfriend.startAnimation (Anime); terror sendIntent = new intent (); sendIntent.setAction (Intent.ACTION_SEND); sendIntent.putExtra (Intent.EXTRA_TEXT, msg); sendIntent.setType ( "text / plain"); Prarnbwykti (from);}}); ImgFbksetOnClickListener (new OnClickListener () {@Override click (click on the View public void ARG0) {anim = AnimationUtils.loadAnimation (getApplicationContext (), r. More. results); ImgFbkstartAnimation (Anime); Adeptrkadikar ( Categories., Provider. FACEBOOK); initShareIntent ("com.facebook.katana");}}); ImgtwiterksetOnClickListener (new OnClickListener () {@Override on public void (see V) {anim = AnimationUtils.loadAnimation (getApplicationContext (), r. NIM. results); ImgtwiterkstartAnimation (Anime); adapters. Official (categories ., Provider T. Witter);}}); } Private Final ResponseListener Injection DialogListener {@Override Complete on Public Zero (Bundle Value) {Log D. ("Share-bar", "authentication successful"); Last string provider name = values.getString (SocialAuthAdapter.PROVIDER); Log D. ("Share-bar", "provider name =" + provider name); Toast. Maketext (Categories, Provider Name + "Connect", Toast.LnnGHIHORT) Show (); Adapter.updateStatus (msg, new MessageListener (), true); } Cancel Cancel Public On Cancel () {Log D. ("Share-bar", "cancellation"); } @ Override Back to Public Nil () {Log D. ("Share-bar", "closed dialog pressed back key"); } @ Override Error on Public Zero (Social Ethyl Error) {initShareIntent ("com.facebook.katana"); Error.printStackTrace (); Log D. ("Share-time 1", error .ststring ()); Log D. ("Share-Bar 2", error .getMessage ()); }} @SuppressLint ("DefaultLocale") Private Zero initShareIntent (string type) {Boolean found = false; Intent Share = New Intent (android.content.Intent.ACTION_SEND); Share.setType ("text / plain"); // Receives list of intentions to be filled & lt; ResolveInfo & gt; ResInfo = getPackageManager (). QueryIntentActivities (share, 0); If (! ResInfo.isEmpty ()) {for (ResolveInfo information: resInfo) {Log D. ("Message FB", "--------- App ::" + info.activityInfo.packageName.toLowerCase ()); If (info.activityInfo.packageName.toLowerCase ()) are included (info). Info.activityInfo.name.toLowerCase (). In (type)) {share.putExtra (Intent.EXTRA_SUBJECT, "eCard"); Share.putExtra (Intent.EXTRA_TEXT, msg); Share.setPackage (info.activityInfo.packageName); Found = true; break; }} If (! Found) return; Initial (Intent. Make Binwa (Shout, "Select")); }} Private Class Message Listener Social AuthListener Applicable & lt; Integer & gt; {@ Exclusive on Public Zero (String Provider, Integer T) {Integer Status = T; If (status.intValue () == 200 || status.intValue () == 201 || status.intValue () == 204) Toast. Maketext (Categories, "Message has been posted" + Provider, toast. Langtha_long). Show (); And toast Maketext (Categories. Thus, "Message" + Provider, Toast has not been posted on LNNHLL). Show (); } @ Override Public Wide On Arrayer (Social Ethyl E) {}
Comments
Post a Comment