Skip to content

Commit

Permalink
Fix dialer intent flag
Browse files Browse the repository at this point in the history
  • Loading branch information
benwicks committed Jul 2, 2019
1 parent 41f7eaf commit de912b1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public static void sendEmail(Context context, String email) {

public static void openDialer(Context context, String phone) {
Intent intent = new Intent(Intent.ACTION_DIAL, Uri.fromParts("tel", phone, null));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ fun Context.sendEmail(email: String) {

fun Context.openDialer(phone: String) {
val intent = Intent(Intent.ACTION_DIAL, Uri.fromParts("tel", phone, null))
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
this.startActivity(intent)
}

Expand Down Expand Up @@ -81,4 +82,4 @@ fun String.copyToClipboard(context: Context, label: String) {
} ?: kotlin.run {
Toast.makeText(context, "Error copying to Clipboard", LENGTH_SHORT).show()
}
}
}

0 comments on commit de912b1

Please sign in to comment.