Skip to content

Commit

Permalink
Customer chooser label
Browse files Browse the repository at this point in the history
Merged PR chirag04#42
  • Loading branch information
Nicolas Morel committed Feb 21, 2017
1 parent ae34123 commit 563d90a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions android/src/main/java/com/chirag/RNMail/RNMailModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ private String[] readableArrayToStringArray(ReadableArray r) {
@ReactMethod
public void mail(ReadableMap options, Callback callback) {
Intent i = new Intent(Intent.ACTION_SEND_MULTIPLE);
i.setType("text/plain");
i.setType("vnd.android.cursor.dir/email");

if (options.hasKey("subject") && !options.isNull("subject")) {
i.putExtra(Intent.EXTRA_SUBJECT, options.getString("subject"));
Expand Down Expand Up @@ -110,7 +110,13 @@ public void mail(ReadableMap options, Callback callback) {
callback.invoke("error");
}
} else {
Intent chooser = Intent.createChooser(i, "Send Mail");
String chooserLabel;
if (options.hasKey("chooserLabel") && !options.isNull("chooserLabel")) {
chooserLabel = options.getString("chooserLabel");
} else {
chooserLabel = "Send Mail";
}
Intent chooser = Intent.createChooser(i, chooserLabel);
chooser.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

try {
Expand Down

0 comments on commit 563d90a

Please sign in to comment.