我有一個在webViewActivity中加載的文檔,在這個文檔中我有我的電子郵件ID。當用戶點擊我的電子郵件ID我想打開電子郵件應用程序,請幫助我。如何發送來自webviewActivity的郵件android
This is sample document.
This is text contained in document. if you have any queries please contact me at [email protected]
我有一個在webViewActivity中加載的文檔,在這個文檔中我有我的電子郵件ID。當用戶點擊我的電子郵件ID我想打開電子郵件應用程序,請幫助我。如何發送來自webviewActivity的郵件android
This is sample document.
This is text contained in document. if you have any queries please contact me at [email protected]
試試這個:
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
//Check whether url contains email or not.
// To start Email Intent
String[] mailto = { "example.com" };
// Create a new Intent to send messages
Intent sendIntent = new Intent(Intent.ACTION_SEND);
// Add attributes to the intent
sendIntent.putExtra(Intent.EXTRA_EMAIL, mailto);
sendIntent.putExtra(Intent.EXTRA_SUBJECT, "This is sample document.");
sendIntent.setType("message/rfc822");
startActivity(sendIntent);
return true;
}
希望這有助於。
請檢查此:http://stackoverflow.com/questions/9387999/how-to-open-webview-link-to-new-activity – Nostradamus
也許解決方法是在這裏:http://stackoverflow.com/questions/2197741/how-to-send-email-from-my-android-application –