mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-04 23:02:02 +01:00
handle mailto: url, and add one. Note that everything about the url
is ignored, just routes to existing Utils.email() method.
This commit is contained in:
parent
ce9c345aa9
commit
f3e41486ca
2 changed files with 17 additions and 3 deletions
|
@ -12,8 +12,8 @@
|
|||
individually (and only when open) to the app communicating on behalf
|
||||
of all games. You should notice only that moves are transmitted
|
||||
more reliably. But this being new code you may also notice bugs.
|
||||
If you don't tell me about them (see the "Email author"
|
||||
menuitem) they will not get fixed.
|
||||
If you don't <a href="mailto:xwords@eehouse.org">tell me about
|
||||
them</a> they will not get fixed.
|
||||
</p>
|
||||
|
||||
<h3>New with this release</h3>
|
||||
|
|
|
@ -23,6 +23,7 @@ package org.eehouse.android.xw4;
|
|||
import android.app.AlertDialog;
|
||||
import android.content.Context;
|
||||
import android.webkit.WebView;
|
||||
import android.webkit.WebViewClient;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
|
@ -33,7 +34,7 @@ import java.io.Reader;
|
|||
*/
|
||||
|
||||
public class FirstRunDialog {
|
||||
public static void show( Context context )
|
||||
public static void show( final Context context )
|
||||
{
|
||||
String page = null;
|
||||
InputStream inputStream = null;
|
||||
|
@ -71,6 +72,19 @@ public class FirstRunDialog {
|
|||
// This won't support e.g mailto refs. Probably want to
|
||||
// launch the browser with an intent eventually.
|
||||
WebView view = new WebView( context );
|
||||
view.setWebViewClient( new WebViewClient() {
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading( WebView view,
|
||||
String url ) {
|
||||
boolean result = false;
|
||||
if ( url.startsWith("mailto:") ){
|
||||
Utils.emailAuthor( context );
|
||||
result = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
});
|
||||
|
||||
view.loadData( page, "text/html", "utf-8" );
|
||||
|
||||
AlertDialog dialog = new AlertDialog.Builder( context )
|
||||
|
|
Loading…
Reference in a new issue