Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Android
Search Coderanch
Advance search
Google search
Register / Login
This week's book giveaway is in the
Spring
forum.
We're giving away four copies of
Java Persistence with Spring Data and Hibernate
and have Cătălin Tudose on-line!
See
this thread
for details.
Win a copy of
Java Persistence with Spring Data and Hibernate
this week in the
Spring
forum!
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Ron McLeod
Tim Cooke
Paul Clapham
Liutauras Vilda
Sheriffs:
Junilu Lacar
Rob Spoor
Jeanne Boyarsky
Saloon Keepers:
Stephan van Hulst
Carey Brown
Tim Holloway
Piet Souris
Bartenders:
Forum:
Android
email in a broadcastRecver?
Niklas Karlsson
Ranch Hand
Posts: 101
posted 6 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi can someone help me with this problem:
make a intent to sent email IN a broadcastereciver?
i cant get this to work :-(
public class clickerOnNotify extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { String toEmail = "tot@to.com"; Intent intent1 = null; String message = "messages"; String emailAddressList[] = {toEmail}; intent1 = new Intent(Intent.ACTION_SEND); intent1.setType("text/html"); intent1.putExtra(Intent.EXTRA_EMAIL, emailAddressList); intent1.putExtra(Intent.EXTRA_SUBJECT, "subject"); intent1.putExtra(Intent.EXTRA_TEXT, Html.fromHtml(message)); context.startActivity(Intent.createChooser(intent, "chose E-client:")); } }
Niklas Karlsson
Ranch Hand
Posts: 101
posted 6 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
manifest:
<receiver android:name=".clickerOnNotify" > <intent-filter> <action android:name="YES_ACTION"/> <action android:name="NO_ACTION"/> <action android:name="MAYBE_ACTION"/> <action android:name="STOP_ACTION"/> </intent-filter>
Niklas Karlsson
Ranch Hand
Posts: 101
posted 6 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
PLEASE NOTE that "context" is NOT from a activity!
Niklas Karlsson
Ranch Hand
Posts: 101
posted 6 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
PLEASE NOTE that "context" is NOT from a activity!
We're being followed by intergalactic spies! Quick! Take this tiny ad!
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Firebase notification that resolves into a notification and mail button with mail-intent?
issue: no application can perform this action , when send mail
Android - center justified email body from Intent
sending an email using intent
Sending an Email with JavaMail
More...