You will need two activities
- Screensaver (use the timer and after x seconds proceed to the next step)
- the main
In the main action, you will need to set the layout with webView in your layout, so something like:
<?xml version="1.0" encoding="utf-8"?> <WebView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/webview" android:layout_width="fill_parent" android:layout_height="fill_parent" />
and code:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); mWebView = (WebView) findViewById(R.id.webview); mWebView.getSettings().setJavaScriptEnabled(true); mWebView.loadUrl("http://www.google.com"); }
and permissions:
<uses-permission android:name="android.permission.INTERNET" />
in the manifest file.
If you want to disable the title bar, you also need to add:
<activity android:name=".Main" android:label="@string/app_name" android:theme="@android:style/Theme.NoTitleBar">
Read the docs for more help! A Google example for this is accurate and I refer to http://developer.android.com/resources/tutorials/views/hello-webview.html
Graham smith
source share