| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.chrome.browser; | 5 package org.chromium.chrome.browser; |
| 6 | 6 |
| 7 import android.accounts.Account; | 7 import android.accounts.Account; |
| 8 import android.accounts.AccountManager; | 8 import android.accounts.AccountManager; |
| 9 import android.content.Context; | 9 import android.content.Context; |
| 10 import android.content.Intent; | 10 import android.content.Intent; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 | 54 |
| 55 Intent send = new Intent(Intent.ACTION_SEND); | 55 Intent send = new Intent(Intent.ACTION_SEND); |
| 56 send.setType("message/rfc822"); | 56 send.setType("message/rfc822"); |
| 57 if (possibleEmails.size() != 0) { | 57 if (possibleEmails.size() != 0) { |
| 58 send.putExtra(Intent.EXTRA_EMAIL, | 58 send.putExtra(Intent.EXTRA_EMAIL, |
| 59 possibleEmails.toArray(new String[possibleEmails.size()])); | 59 possibleEmails.toArray(new String[possibleEmails.size()])); |
| 60 } | 60 } |
| 61 send.putExtra(Intent.EXTRA_SUBJECT, subject); | 61 send.putExtra(Intent.EXTRA_SUBJECT, subject); |
| 62 send.putExtra(Intent.EXTRA_TEXT, Html.fromHtml(body)); | 62 send.putExtra(Intent.EXTRA_TEXT, Html.fromHtml(body)); |
| 63 try { | 63 try { |
| 64 Intent chooser = Intent.createChooser(send, chooserTitle)); | 64 Intent chooser = Intent.createChooser(send, chooserTitle); |
| 65 // we start this activity outside the main activity. | 65 // we start this activity outside the main activity. |
| 66 chooser.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); | 66 chooser.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); |
| 67 context.startActivity(chooser); | 67 context.startActivity(chooser); |
| 68 } catch (android.content.ActivityNotFoundException ex) { | 68 } catch (android.content.ActivityNotFoundException ex) { |
| 69 // If no app handles it, do nothing. | 69 // If no app handles it, do nothing. |
| 70 } | 70 } |
| 71 } | 71 } |
| 72 } | 72 } |
| OLD | NEW |