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

  • Home
  • SEARCH
  • 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 8610801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T04:12:47+00:00 2026-06-12T04:12:47+00:00

Thanks to this tutorial: http://mobile.tutsplus.com/tutorials/android/android-sdk-implement-a-share-intent/ I know how to simply share my message: I

  • 0

Thanks to this tutorial: http://mobile.tutsplus.com/tutorials/android/android-sdk-implement-a-share-intent/ I know how to simply share my message: I simply create the intent and start activity.
However, there’s a little latency between startActivity call and effective show of the share windows so I’d like to make a custom activity with, for example, a listview of suitable apps for that type of sharing.

I thus need:

edit:
1) A way to get a list of apps wich can handle the intent, in my case an ACTION.SEND intent with a text/plain mime type.

2)A way to start them with my message body and subject.

  • 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-12T04:12:48+00:00Added an answer on June 12, 2026 at 4:12 am

    Get the list of installed application:

    final PackageManager pm = getPackageManager();
    
    List<ApplicationInfo> packages = pm.getInstalledApplications(PackageManager.GET_META_DATA);
    
    for (ApplicationInfo packageInfo : packages) {
    
       Log.d(TAG, "Installed package :" + packageInfo.packageName);
       Log.d(TAG, "Launch Activity :" + pm.getLaunchIntentForPackage(packageInfo.packageName)); 
    
       }// the getLaunchIntentForPackage returns an intent that you can use with startActivity() 
    }
    

    and to launch that package:

    protected void launchApp(String packageName) {
        Intent mIntent = getPackageManager().getLaunchIntentForPackage(packageName);
        if (mIntent != null) {
            try {
                startActivity(mIntent);
            } catch (ActivityNotFoundException err) {
                Toast t = Toast.makeText(getApplicationContext(),
                "Application not found", Toast.LENGTH_SHORT);
                t.show();
            }
        }
    }
    

    EDIT

    This method queries the package manager for installed packages that can respond to an intent with the specified action:

    public static boolean isIntentAvailable(Context context, String action) {
        final PackageManager packageManager = context.getPackageManager();
        final Intent intent = new Intent(action);
        List<ResolveInfo> list =
        packageManager.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY);
        return list.size() > 0;
    }
    

    and to share your text using a specific application (which can handle ACTION_SEND):

    ResolveInfo info = list.get(index);
    Intent intent = new Intent(android.content.Intent.ACTION_SEND);
    intent.setClassName(info.activityInfo.packageName, info.activityInfo.name);
    intent.setType("text/plain");
    intent.putExtra(Intent.EXTRA_SUBJECT, subject);
    intent.putExtra(Intent.EXTRA_TEXT, body);
    ((Activity)context).startActivity(intent);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've created a contact us form. I followed this tutorial: http://mobile.tutsplus.com/tutorials/android/android-sdk-creating-forms/ The tutorial is
Im using this guide to implement a ViewPager : http://mobile.tutsplus.com/tutorials/android/android-user-interface-design-horizontal-view-paging/ This is my main.xml
in this tutorial : http://mobile.tutsplus.com/tutorials/android/android-user-interface-design-building-application-preference-screens/ they talk about the preference state, and the following
I have followed the tutorial on http://mobile.tutsplus.com/tutorials/iphone/ios-sdk-game-center-achievements-and-leaderboards-part-1/ and managed to get everything work.. The
i'm following this tutorial: http://net.tutsplus.com/tutorials/javascript-ajax/uploading-files-with-ajax/comment-page-1/#comments to learn how to upload multiple files via ajax.
I am integrating this Twitter API in my project. http://mobile.tutsplus.com/tutorials/iphone/twitter-api-iphone/ This is running well
Hi I have used this tutorial http://net.tutsplus.com/tutorials/javascript-ajax/submit-a-form-without-page-refresh-using-jquery/ to create php - jquery - ajax
I'm using a slightly augmented virtual keyboard from this tutorial: http://net.tutsplus.com/tutorials/javascript-ajax/creating-a-keyboard-with-css-and-jquery/ The Jquery: $(function(){
I have this Drag Drop UI, here , created from this tutorial http://net.tutsplus.com/tutorials/javascript-ajax/inettuts/ I
I have followed this tutorial ( http://developer.android.com/resources/tutorials/views/hello-tabwidget.html ) and completed the task and it

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.