Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7020045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:16:00+00:00 2026-05-27T23:16:00+00:00

Currently I have a pretty standard ACTION_SEND intent to share information from inside my

  • 0

Currently I have a pretty standard ACTION_SEND intent to share information from inside my app. Code is similar to what is below:

    Intent intent = new Intent(Intent.ACTION_SEND);
    intent.setType("text/plain");
    intent.putExtra(Intent.EXTRA_SUBJECT, subject);
    intent.putExtra(Intent.EXTRA_TEXT, text);
    context.startActivity(Intent.createChooser(intent, title));

Now, if the user has the Facebook app installed on their phone then Facebook shows up as an option for the intent chooser. However, I want to intercept the user’s click on “Facebook” and use the Facebook SDK to carry out the task instead of the Facebook application already on the users phone. Is there a way to intercept the onClick for the Facebook option? Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T23:16:00+00:00Added an answer on May 27, 2026 at 11:16 pm

    Here is a link to my blog post with a detailed solution, including code and screen shots.

    http://clickclickclack.wordpress.com/2012/01/03/intercepting-androids-action_send-intents/

    As quoted from that article:

    [W]e first create a new action_send intent and set the type to
    text/plain. Next, we create a List. We make the call to the package
    manager to query for all Activities with the action_send intent
    registered. This call returs a list of ResolveInfo objects, each
    corresponding to an Activity on the device that claims to handle send
    actions.

    [Then, r]ather than launching the action_send intent and letting it
    create its own dialog (one that we would have no control over), we
    will build our own with the AlertDialog.Builder. First we give it a
    title, then set its adapter to the list adapter we just created with
    the activities list as our data set[.]

    The next important piece we need to look at is the OnClick listener we
    gave the Builder. To find which item the user clicked, we use the
    adapter.getItem(int which) method. This will return the object in that
    position of our original list, in this case, a ResolveInfo object
    corresponding to the selected Activity. For my case in particular, I
    only care about separating things into two groups: Facebook and not
    Facebook. To do this, I simply check if the selected Activity’s
    package name contains ‘facebook’. If it does not, I create a new
    action_send intent, set the class name to the selected activity, and
    launch it. However, if the package name DOES contain ‘facebook’, I
    instantiated my personal PostToFacebookDialog object which will create
    a basic Android dialog with post and cancel buttons, and will post to
    Facebook directly using the Graph API, thus circumventing the user’s
    installed Facebook app.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently writing an financial application, and we have a pretty standard customer
I currently have a a pretty standard jqgrid that I would like to change
I'm pretty new into asp.net, and currently I have the need for storing various
I am currently using some pretty standard code to enumerate assets in a group.
I have a pretty standard table set-up in a current application using the .NET
We currently have code like this: Dim xDoc = XDocument.Load(myXMLFilePath) The only way we
I'm pretty new to JavaScript, which I am learning on my own. I'm currently
i'm having a situation (pretty standard for everybody i guess), where i have to
I have a pretty standard Java Desktop Application in NetBeans. I recently added a
I have a pretty standard attendance database design, but I want to be alerted

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.