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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T04:50:01+00:00 2026-06-06T04:50:01+00:00

I had developed an application for sending email. On click of email button it

  • 0

I had developed an application for sending email. On click of email button it should ask user to choose one of email clients installed in phone. But, in my case additionally it is showing option of bluetooth which is not required. I searched alot but couldn’t got any solution. Below I am posting my code.

public class EtestActivity extends Activity {
/** Called when the activity is first created. */
Button email;
Intent in;
private static final String TAG = "EmailLauncherActivity";
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    email = (Button)findViewById(R.id.email);
    email.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {
            // TODO Auto-generated method stub
            try {
                in = new Intent(Intent.ACTION_SEND);
                in.setType("image/jpg");
                in.setType("plain/text");
                in.setType("application/octet-stream");
                in.putExtra(Intent.EXTRA_EMAIL, new String[]{"pranav_kotauniv@yahoo.co.in","friendlynitish@gmail.com"});
                in.putExtra(Intent.EXTRA_STREAM, Uri.parse("file:///sdcard/android.jpg"));  
                startActivity(Intent.createChooser(in, "mailto:"));
            } catch (Exception e) {
                Log.e(TAG, "email sending failed", e);
            }//catch
        }//onClick
    });
}//onCreate

}//class

  • 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-06T04:50:02+00:00Added an answer on June 6, 2026 at 4:50 am

    Code for sending email. Using PackageManager(http://developer.android.com/reference/android/content/pm/PackageManager.html), we can avoid getting different choices.

    private void sendEpost(String type) {
    boolean found = false;
    Intent in = new Intent(android.content.Intent.ACTION_SEND);
    in.setType("image/jpeg");
    in.setType("application/octet-stream");
    List<ResolveInfo> resInfo = getPackageManager().queryIntentActivities(in, 0);
    if (!resInfo.isEmpty()){
        for (ResolveInfo info : resInfo) {
            if (info.activityInfo.packageName.toLowerCase().contains(type) || 
                    info.activityInfo.name.toLowerCase().contains(type) ) {
                in.putExtra(Intent.EXTRA_EMAIL, new String[]{});
                in.putExtra(Intent.EXTRA_SUBJECT,  "subject");
                in.putExtra(Intent.EXTRA_TEXT,     "your text");
                in.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new File(Environment.getExternalStorageDirectory()
                        .getAbsolutePath().toString()+"/diplomat/"+adapter.readName(touches))));
                in.setPackage(info.activityInfo.packageName);
                found = true;
                break;
            }
        }
        if (!found)
            return;
        startActivity(Intent.createChooser(in, "Select"));
    }
    }//sendEpost
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I had developed an application. The size i developed was 3.7in WVGA Nexus One
I have developed one application Where user can have 4 trials available for free.
I had developed Android Application which has Login Authentication Page. When the user logs
I had developed an application in which I have to display images from specific
I had developed one website purely in HTML .I have my form with fields
I had developed an application using .NET 2.0 and database as Sql Server 2005.
I had developed a Desktop Application in .Net. I had published and deployed it
at work we have an application that, at first, had been developed for a
I had developed an application. I done 2 sets of layout which were default
Say for example I had an application sending the following HTTP headers to set

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.