summaryrefslogtreecommitdiffstats
path: root/src/net
diff options
context:
space:
mode:
authorSteve Slaven <bpk@hoopajoo.net>2011-01-06 21:02:46 (GMT)
committerSteve Slaven <bpk@hoopajoo.net>2011-01-06 21:02:46 (GMT)
commitb6bb709a15ee1d0f5c80735c8cf42a16c6c464d3 (patch)
tree98bbd7d0bd6f06c59c2cc89c81ad49cb461aadcd /src/net
parentbe138f4be268bcd996916203f2ed2821e4f46d5c (diff)
downloadSoftKeys-b6bb709a15ee1d0f5c80735c8cf42a16c6c464d3.zip
SoftKeys-b6bb709a15ee1d0f5c80735c8cf42a16c6c464d3.tar.gz
SoftKeys-b6bb709a15ee1d0f5c80735c8cf42a16c6c464d3.tar.bz2
Fix doc navigation but on froyo
Diffstat (limited to 'src/net')
-rw-r--r--src/net/hoopajoo/android/SoftKeys/QuickDoc.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/net/hoopajoo/android/SoftKeys/QuickDoc.java b/src/net/hoopajoo/android/SoftKeys/QuickDoc.java
index 3b7a078..7e0ac76 100644
--- a/src/net/hoopajoo/android/SoftKeys/QuickDoc.java
+++ b/src/net/hoopajoo/android/SoftKeys/QuickDoc.java
@@ -27,13 +27,16 @@ import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
+import android.net.Uri;
import android.os.Bundle;
import android.preference.ListPreference;
import android.preference.Preference;
import android.preference.PreferenceActivity;
+import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.webkit.WebView;
+import android.webkit.WebViewClient;
import android.widget.Button;
public class QuickDoc extends Activity {
@@ -60,6 +63,7 @@ public class QuickDoc extends Activity {
WebView mWebView = (WebView) findViewById(R.id.webview);
mWebView.getSettings().setJavaScriptEnabled( false );
+ mWebView.setWebViewClient( new ViewClient() );
mWebView.loadUrl( url );
/*
@@ -78,4 +82,17 @@ public class QuickDoc extends Activity {
public void closeHelp( View v ) {
this.finish();
}
+
+ /* this fixes the browser opening when you click links */
+ public class ViewClient extends WebViewClient {
+ @Override
+ public boolean shouldOverrideUrlLoading(WebView view, String url) {
+ if( url.startsWith( "file://" ) ) {
+ return false;
+ }else{
+ startActivity( new Intent( Intent.ACTION_VIEW, Uri.parse( url ) ) );
+ return true;
+ }
+ }
+ }
}