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 7873643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T02:34:34+00:00 2026-06-03T02:34:34+00:00

Her is what I’m trying to accomplish: When user tries to share some text

  • 0

Her is what I’m trying to accomplish:

  1. When user tries to share some text from any app (Like sharing a tweet or a link), my app will appear in the sharing list.
  2. If he select my app, some simple code will be run (like showing a Toast) then that’s it. No interface or UI is needed.

Here is how I did it:

AndroidManifest.xml

<receiver 
android:name=".MyBroadcastReceiver" >
    <intent-filter
        android:label="select my app">
        <action android:name="android.intent.action.SEND" />
        <category android:name="android.intent.category.DEFAULT" />
        <data android:mimeType="text/plain" />
    </intent-filter>                
</receiver>

MyBroadcastReceiver.java

public void onReceive(Context arg0, Intent arg1) {
    // TODO Auto-generated method stub
    //Some simple code
    Toast.makeText(arg0, "My Receiver is cool", Toast.LENGTH_LONG).show();
}

This didn’t work, my app doesn’t show in the sharing list.

Why I work with BroadcatReceivers and not with Activities? Because I don’t want any UI and I think that is why we have receivers (correct my plz)

Am I doing it right?

  • 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-06-03T02:34:35+00:00Added an answer on June 3, 2026 at 2:34 am

    This didn’t work, my app doesn’t show in the sharing list.

    ACTION_SEND is used with activities. You are attempting to use a BroadcastReceiver. Since a BroadcastReceiver is not an activity, this will not work.

    Am I doing it right?

    No.

    If he select my app, some simple code will be run (like showing a Toast) then that’s it. No interface or UI is needed.

    You still need an activity. However, if you give the activity Theme.NoDisplay, and you do not call setContentView(), there will be no UI for the activity. Usually, you just call finish() from onCreate() after doing whatever it is you wanted to do (in this case, display a Toast).

    For example, this sample application shows an activity (FauxSender) set up to do precisely what you want: respond to ACTION_SEND with a Toast. It has another activity that issues an ACTION_SEND so you can see the results.

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

Sidebar

Related Questions

I'm developing web app that user can save his/her work to server. The data
My app has a simple signup where the user types in his/her email address
I would like to create an SQL Azure user and grant her read-only access
i am trying to check if user uploaded his or her avatar image and
I am developing an application in which user can share messages with his/her Facebook
I'm currently working on an app where a user has to edit his/her profile.
I want to open windows where user may choose file from his/her computer. Only
Let's say a user from a global site selects his/her country from a drop
Is there any way to force a user to give his/her input via overwriting
I would like to show each user who has visited her/his user profile. At

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.