Note that there are some explanatory texts on larger screens.

plurals
  1. POWebView doesn't work
    primarykey
    data
    text
    <p>I'm just a beginner in Android and I started to deal with webViews. Indeed, I have created two button that will take me into two different activities but when I run the application the webview doesn't load the page which is Google.com. I already inserted the internet permission.</p> <p>Here, I did onClick method as an attribute in the button that when I click on it has to go to the twitter website. I put it in a different activity class.</p> <pre><code> public void listen(View v) { Intent intent = new Intent(getApplicationContext(), onemore.class); startActivity(intent); } </code></pre> <p>this is the activity class</p> <pre><code>package com.example.aboutme; import android.app.Activity; import android.os.Bundle; import android.webkit.WebView; public class onemore extends Activity { private String uagent = "Mozilla/5.0 (Linux; U; Android 2.0; en-us; Droid Build/ESD20) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17"; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.twomore); displayTweets(); } private void displayTweets() { WebView mWebView = (WebView) findViewById(R.id.webView1); mWebView.getSettings().setJavaScriptEnabled(true); mWebView.getSettings().setUserAgentString(uagent); mWebView.loadUrl("http://mobile.twitter.com/"); } } </code></pre> <p>the xml layout</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;WebView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:id="@+id/webView1" /&gt; </code></pre> <p>the manifest xml</p> <pre><code>&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.aboutme" android:versionCode="1" android:versionName="1.0" &gt; &lt;uses-sdk android:minSdkVersion="8" android:targetSdkVersion="15" /&gt; &lt;application android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" &gt; &lt;activity android:name=".WebViewActivity" android:label="@string/app_name" android:theme="@android:style/Theme.NoTitleBar" /&gt; &lt;activity android:name=".MainActivity" android:label="@string/title_activity_main" &gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;activity android:name=".ActivityTwo" android:label="@string/app_name"/&gt; &lt;/application&gt; &lt;uses-permission android:name="android.permission.INTERNET" /&gt; &lt;/manifest&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload