You email is not getting sent because you are not doing anything with
your sendIntent. You create it but then never use it.
On Jul 21, 7:32 am, codefish <92soc...@gmail.com> wrote:
> i want to handle exceptions in Service.
> my exception handler sends error report email.
> so i add FLAG_ACTIVITY_NEW_TASK flag and it works fine in onCreate().
> but in UncaughtExceptionHandler, it doesn't send email.
>
> so how it can send email in uncaughtException()?
>
> public class ErrorReporter implements Thread.UncaughtExceptionHandler
> {
>   //....
>   public void uncaughtException(Thread t, Throwable e) {
>     // ...
>     SendErrorMail(this.CurContext, Report);
>   }
>
>   private void SendErrorMail(Context _context, String ErrorContent) {
>         Intent sendIntent = new Intent(Intent.ACTION_SEND);
>         String subject = ("Crash Report - Android ErrorReporter");
>         String body = ErrorContent + "\n\n";
>         sendIntent.putExtra(Intent.EXTRA_EMAIL, new String[]
> {"92soc...@gmail.com"});
>         sendIntent.putExtra(Intent.EXTRA_TEXT, body);
>         sendIntent.putExtra(Intent.EXTRA_SUBJECT, subject);
>         sendIntent.setType("message/rfc822");
>         Intent i = Intent.createChooser(sendIntent, "Title:");
>         i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);  // because
> Service ...
>         _context.startActivity(i);
>   }
>
> }
>
> thank you

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to