I am trying to build a mailto:
uri to send a mail using the GMail app.
I would like to use the android.net.Uri.Builder
class to do this, but the resulting uri is in the form mailto://[email protected]
, which makes the GMail app think the recipient is //[email protected]
, instead of just [email protected]
.
I ended up doing this:
String uriStr = uriBuilder.toString();
uriStr = uriStr.replaceAll("//", "");
final Uri uri = Uri.parse(uriStr);
but clearly, this is an ugly hack...
Is there no way to build the uri without the //
part?