Back to project page ANA.
The source code is released under:
GNU General Public License
If you think the Android project ANA listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package net.guimi.ANA; /*from w w w.ja v a 2 s .c om*/ import android.app.Activity; import android.os.Bundle; import android.view.KeyEvent; import android.webkit.WebView; import android.webkit.WebViewClient; /* * Copyright (c) 2004-2010 Luis Miguel Armendriz * http://guimi.net * * Est permitido copiar, distribuir y/o modificar * los desarrollos bajo los trminos de la * GNU General Public License, Versin 2 * * Para obtener una copia de dicha licencia * visite http://www.fsf.org/licenses/gpl.txt. * */ public class Web extends Activity { WebView webview; /** * Sobreescribimos la funcin de creacin de la actividad. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Indicamos la distribucin de pantalla (layout) a cargar (xml) setContentView(R.layout.web); webview = (WebView) findViewById(R.id.webview); webview.getSettings().setJavaScriptEnabled(true); webview.loadUrl("http://www.guimi.net/ANA/entrada_movil.php"); webview.setWebViewClient(new miNavegadorWeb()); } @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if ((keyCode == KeyEvent.KEYCODE_BACK) && (webview.canGoBack())) { webview.goBack(); return true; } else return super.onKeyDown(keyCode, event); } private class miNavegadorWeb extends WebViewClient { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { view.loadUrl(url); return true; } } }