Keine Tätigkeit gefunden zu handhaben Vorsatz beim senden der E-Mail

Ich bin versucht, senden Sie das Bild geklickt bis mein Antrag als Anhang per E-Mail. Das Bild geklickt und bekomme ich den Pfad richtig, aber die Anwendung wirft mir einen run-time exception.."Keine Aktivität gefunden zu handhaben Absicht". Ich Teste diese auf meinem Gerät und ich habe mein gmail-Konto konfiguriert. Ich bin nicht sicher, wie diese zu lösen. Bitte helfen Sie.

Dies ist mein code:

public static void sendEmail(Context context, String[] recipientList, String title, String subject, String body) {

Intent intent = new Intent(Intent.ACTION_SENDTO,    Uri.parse("mailto:[email protected]"));
        intent.setType("plain/text");
        intent.putExtra(android.content.Intent.EXTRA_EMAIL, recipientList);
        intent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject);
        intent.putExtra(android.content.Intent.EXTRA_TEXT, body);
        intent.putExtra(Intent.EXTRA_STREAM, capturedImageFilePath);
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        context.startActivity(intent);

}

- Und das ist das log:

01-15 11:26:04.455: E/AndroidRuntime(9904): FATAL EXCEPTION: main
01-15 11:26:04.455: E/AndroidRuntime(9904): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.SENDTO typ=plain/text flg=0x10000000 (has extras) }
01-15 11:26:04.455: E/AndroidRuntime(9904):     at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1512)
01-15 11:26:04.455: E/AndroidRuntime(9904):     at android.app.Instrumentation.execStartActivity(Instrumentation.java:1384)
01-15 11:26:04.455: E/AndroidRuntime(9904):     at android.app.ContextImpl.startActivity(ContextImpl.java:852)
01-15 11:26:04.455: E/AndroidRuntime(9904):     at android.content.ContextWrapper.startActivity(ContextWrapper.java:276)
01-15 11:26:04.455: E/AndroidRuntime(9904):     at com.example.attachmail.AttchmentActivity.sendEmail(AttchmentActivity.java:133)
01-15 11:26:04.455: E/AndroidRuntime(9904):     at com.example.attachmail.AttchmentActivity$2.onClick(AttchmentActivity.java:93)
  • Versuchen Sie, die Intent.FLAG_DEBUG_LOG_RESOLUTION Flagge. Es könnte Ihnen helfen, es herauszufinden.
  • Versucht Vorsatz.FLAG_DEBUG_LOG_RESOLUTION wirft mir folgende exception:: Aufruf von startActivity() von außerhalb einer Aktivität Kontext erfordert die FLAG_ACTIVITY_NEW_TASK Flagge. Ist das wirklich das, was Sie wollen?
InformationsquelleAutor Nisha | 2013-01-15
Schreibe einen Kommentar