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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:03:32+00:00 2026-06-15T16:03:32+00:00

I am trying to create a application for android in which I want to

  • 0

I am trying to create a application for android in which I want to allow user to share text using my application.

The code that I have is as follow. Please help me find the error.

I don’t have logcat message because whenever I ran the sharer application in emulator and clicked on share button it directly opened the stock message application, despite my other application being installed in the emulator, so I had to test the application on my phone.

CODE OF APPLICATION I CREATED FOR SHARING

Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, "This is my text to send.");
sendIntent.setType("text/plain");
startActivity(Intent.createChooser(sendIntent, getResources().getText(R.string.send_to)));

MAIN APPLICATION

MANIFEST DECLARATION

<activity
        android:name="com.example.app.MainActivity"
        android:label="@string/title_activity_main"
        android:screenOrientation="portrait" >
        <intent-filter>
            <action android:name="android.intent.action.SEND" />

            <category android:name="android.intent.category.DEFAULT" />

            <data android:mimeType="text/plain" />
        </intent-filter>
    </activity>

CODE FROM MAINACTIVITY.JAVA

Intent myintent = getIntent();
String action = myintent.getAction();
String type = myintent.getType();

if(Intent.ACTION_SEND.equals(action) && type !=null) {
    if("text/plain".equals(type)) {
        handleSendText(myintent);
  }
}

void handleSendText(Intent intent) {
    String sharedText = intent.getStringExtra(Intent.EXTRA_TEXT);
    if (sharedText != null) {
        editText.setText(sharedText);
    }
}

Please help me find the error why there no Intent Chooser pop up with my application and the stock message application.

  • 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-15T16:03:33+00:00Added an answer on June 15, 2026 at 4:03 pm

    Try to run it in emulator and use debugger to find where your app is crashed then write it here try use catching exceptions

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

Sidebar

Related Questions

I have been trying to create a simple application that will let the user
I am currently trying to create an Android application that loops Audio from the
I am trying to create a simple Android application that has a ActivityList of
I'm trying to create arabic database in android application and want to see how
I'm trying to create an application that uses the iPhone MapView (under Google Code).
I'm trying to create a setup activity for my Android application which my users
I am trying to create application, which sould work this way: User dial a
I'm trying to create an application that can use the android as a fax
I am trying to create a sample app for Android which can have push
I am trying to create an application in Android 2.2 which sends SMS to

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.