0

私は webViewActivity に読み込まれたドキュメントを持っています。このドキュメントには私の電子メール ID があります。ユーザーが自分のメール ID をクリックしたときに、メール アプリを開きたいのですが、助けてください。

This is sample document. 
          This is text contained in document. if you have any queries please contact me at mailto@examplemail.com 
4

1 に答える 1

2

これを試して :

    @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;

    }

お役に立てれば。

于 2013-10-28T11:34:56.490 に答える