I am having and issue with the line "emailIntent.setType(HTTP.PLAIN_TEXT_TYPE);" as it says cannot resolve issue for the PLAIN_TEXT_TYPE part. I am working through this: https://developer.android.com/training/basics/intents/sending.html and kept the code the same.

setType takes a String so you can circumvent it (as it says in the comment) by doing this:
emailIntent.setType("text/plain");
I did a quick Google, looks like the docs made sense for Android v5 but not since then :-) aka above Marshmallow. HTTP.PLAIN_TEXT_TYPE is apart of apache http which used to be bundled with Android. What code do I need to fix Apache HTTP Client removal?
TLDR just use the String as above.
https://developer.android.com/about/versions/marshmallow/android-6.0-changes#behavior-apache-http-client
Raised a bug for them to fix the docs: https://issuetracker.google.com/issues/148429148 :-)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With