Facing error with Intent

Please see this :
https://codinginflow.com/tutorials/android/email-intent

Or Try This Code :

Intent intent = new Intent(Intent.ACTION_SENDTO); // it's not ACTION_SEND
intent.putExtra(Intent.EXTRA_SUBJECT, "Subject of email");
intent.putExtra(Intent.EXTRA_TEXT, "Body of email");
intent.setData(Uri.parse("mailto:default@recipient.com")); // or just "mailto:" for blank
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // this will make such that when user returns to your app, your app is displayed, instead of the email app.
startActivity(intent);
1 Like

You can access that method only using a valid context.

1 Like

Means ? :sweat_smile::sweat_smile::sob:

Get a context
Then use this method.
context.blahblahblah()
But don't forget to add ; at end :joy:

2 Likes

you already can do this easily using the activity starter component...
How to send an eMail
which means, it does not really help very much to provide exactly the same functionality as extension...

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.

2 Likes

yeah, i know that

i want to learn it therefore for example i have used mailto links. i am not gonna to publish that extension

Hmm, you are weird.

i want to learn only

2 Likes

In my opinion, this error is not due to code, I think it's because your block form is wrong

1 Like

Hmm. is all libraries of android are installed in extension templete?

still i can't understood? :face_with_thermometer: :face_with_head_bandage: :frowning_face: :sob: :sob: :sob: :sob:

1 Like

lol, i think i am using old version of extension template. there are some libs are missing in my template.

Then is it successful

1 Like

not tried yet

okay :grin:

next year came did it worked :rofl: if yes soon mark solution

1 Like

Done :+1:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.