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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T23:17:37+00:00 2026-06-04T23:17:37+00:00

I want to create one application which share image on twitter. But when i

  • 0

I want to create one application which share image on twitter.
But when i click on button it show message “no application perform this action”.
is there any wrong in following code?

private void share()
    {
    // TODO Auto-generated method stub
        Intent tweetIntent = new Intent(Intent.ACTION_SEND);
        tweetIntent.setType("application/twitter");
        tweetIntent.putExtra(android.content.Intent.EXTRA_TEXT, "Test; please ignore");

        startActivity(Intent.createChooser(tweetIntent, "Choose one"));

    }
  • 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-04T23:17:39+00:00Added an answer on June 4, 2026 at 11:17 pm

    The Twitter application needs to be installed and probably the user needs to be actively logged in (most people are) for this to work. I don’t think the tweetIntent.setType("application/twitter"); works, I’ve never seen that. You can limit the share against Twitter by filtering by it’s application package name, tweetIntent.setPackage("com.twitter.android");. You’ll want to verify that this is available to you by using the PackageManager. Here’s the possible code below, I didn’t test this.

    Intent tweetIntent = new Intent(Intent.ACTION_SEND);
    tweetIntent.setPackage("com.twitter.android");
    tweetIntent.putExtra(android.content.Intent.EXTRA_TEXT, "Test; please ignore");
    
    PackageManager pm = context.getPackageManager();
    if(pm.queryIntentActivities (tweetIntent, 0).size() > 0) { // If there's at least 1 intent that matches then the intent is valid.
      startActivity(Intent.createChooser(tweetIntent, "Choose one"));
    } else {
      // Not supported.
    }
    

    Android’s share intent is meant for sending data for sharing to other applications. It’s possible that you can limit the share to a specific application like you are doing. But, you’re going against the grain of how Android works and you open yourself up to incompatibility issues by doing it. You might be better off using the Twitter API directly.

    The rationale is that if the user doesn’t have Twitter installed then chances are they don’t really care about it. But they might want to share the content on another service like Facebook.

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

Sidebar

Related Questions

I want to develop one application in blackberry.In that application i want to create
I am developing one chat application and i want to create a chat screen
i want to create an application in one row of tableView there will be
I want to create one virtualenv using another as the starting point, is this
I want to create one proc like below but it has error on syntax.
i want to create one textbox which accept city or country name and when
want to share a link from my application in windows phone 7. Any one
I have one application in which I have two images. The first image is
I am creating an application in which I want to capture a image and
I created one application, its working fine. I want to support my application in

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.