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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:00:04+00:00 2026-06-14T15:00:04+00:00

This class works fine on ICS, but fails with ActivityNotFoundException on Jelly Bean. Do

  • 0

This class works fine on ICS, but fails with ActivityNotFoundException on Jelly Bean. Do you guys know why? Thank you.

public class EmailSender {

    public static Intent getSendEmailIntent(Context context, String email,
                                            String subject, String body, File fileName, String chooserTitle) {

        final Intent emailIntent = new Intent(
                android.content.Intent.ACTION_SEND);

        //Explicitly only use Gmail to send
        emailIntent.setClassName("com.google.android.gm", "com.google.android.gm.ComposeActivityGmail");

        emailIntent.setType("plain/text");

        //Add the recipients
        emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL,
                new String[]{email});

        emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject);

        emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, body);

        //Add the attachment by specifying a reference to our custom ContentProvider
        //and the specific file of interest
        emailIntent.putExtra(
                Intent.EXTRA_STREAM,
                Uri.fromFile(fileName));

        return emailIntent;
    }
}

On Jelly Bean I’m getting an exception:

11-19 15:32:07.852: E/AndroidRuntime(19630):
android.content.ActivityNotFoundException: Unable to find explicit
activity class
{com.google.android.gm/com.google.android.gm.ComposeActivityGmail};
have you declared this activity in your AndroidManifest.xml?

Full trace in case of need:

11-19 15:32:07.852: E/AndroidRuntime(19630):
android.content.ActivityNotFoundException: Unable to find explicit
activity class
{com.google.android.gm/com.google.android.gm.ComposeActivityGmail};
have you declared this activity in your AndroidManifest.xml? 11-19
15:32:07.852: E/AndroidRuntime(19630): at
android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1618)
11-19 15:32:07.852: E/AndroidRuntime(19630): at
android.app.Instrumentation.execStartActivity(Instrumentation.java:1417)
11-19 15:32:07.852: E/AndroidRuntime(19630): at
android.app.Activity.startActivityForResult(Activity.java:3370) 11-19
15:32:07.852: E/AndroidRuntime(19630): at
android.app.Activity.startActivityForResult(Activity.java:3331) 11-19
15:32:07.852: E/AndroidRuntime(19630): at
android.support.v4.app.FragmentActivity.startActivityFromFragment(FragmentActivity.java:701)
11-19 15:32:07.852: E/AndroidRuntime(19630): at
android.support.v4.app.Fragment.startActivity(Fragment.java:787) 11-19
15:32:07.852: E/AndroidRuntime(19630): at
ebeletskiy.gmail.com.passwords.ui.Export.sendByEmail(Export.java:91)
11-19 15:32:07.852: E/AndroidRuntime(19630): at
ebeletskiy.gmail.com.passwords.ui.Export.access$400(Export.java:22)
11-19 15:32:07.852: E/AndroidRuntime(19630): at
ebeletskiy.gmail.com.passwords.ui.Export$1.onClick(Export.java:57)
11-19 15:32:07.852: E/AndroidRuntime(19630): at
android.view.View.performClick(View.java:4202) 11-19 15:32:07.852:
E/AndroidRuntime(19630): at
android.view.View$PerformClick.run(View.java:17340) 11-19
15:32:07.852: E/AndroidRuntime(19630): at
android.os.Handler.handleCallback(Handler.java:725) 11-19
15:32:07.852: E/AndroidRuntime(19630): at
android.os.Handler.dispatchMessage(Handler.java:92) 11-19
15:32:07.852: E/AndroidRuntime(19630): at
android.os.Looper.loop(Looper.java:137) 11-19 15:32:07.852:
E/AndroidRuntime(19630): at
android.app.ActivityThread.main(ActivityThread.java:5039) 11-19
15:32:07.852: E/AndroidRuntime(19630): at
java.lang.reflect.Method.invokeNative(Native Method) 11-19
15:32:07.852: E/AndroidRuntime(19630): at
java.lang.reflect.Method.invoke(Method.java:511) 11-19 15:32:07.852:
E/AndroidRuntime(19630): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
11-19 15:32:07.852: E/AndroidRuntime(19630): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) 11-19
15:32:07.852: E/AndroidRuntime(19630): at
dalvik.system.NativeStart.main(Native Method)

  • 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-14T15:00:06+00:00Added an answer on June 14, 2026 at 3:00 pm

    I’d advise against using an intent to directly open the gmail compose activity. Using such a strict intent means that the user needs to have gmail installed to use your app. Not everybody uses gmail for their mail client.. Additionally, by hardcoding class names you leave yourself open to instances where the class name changes can result in your activity breaking (which is the cause of your current problem)

    I decompiled the gmail 4.2 application and found that the ComposeActivity class name and path has changed.. it is now com.android.mail.compose.ComposeActivity

    You should use a general email intent that allows the user to use the email application of their choosing

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

Sidebar

Related Questions

I have this class here and I using box-shadow which works fine, but it
I´m dynamically creating an instance of a class with reflection and this works fine,
This seems to work fine in C#: class A : System.Attribute { public A()
This code works: class Test { public: Test(string name) : _name(name) {}; bool operator()()
I found out this morning that proc.new works in a class initialize method, but
I am using this class to encode/decode text to base64. It works fine with
This works fine class Window.AppViewModel message : ko.observable() chatMessages : ko.observableArray() canSendMessage : ko.observable(false)
(NOTE: Dictionary where T is some ProtoContract / ProtoMembered class works fine. ) This
Serializing this class works fine. However, sometimes I'd like to exclude the field. Is
The following singleton class works fine, public class Elvis { private static Elvis elvis

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.