Note that there are some explanatory texts on larger screens.

plurals
  1. POWebview with intent filters
    primarykey
    data
    text
    <p>I am trying to create a webview but it's not showing up when I am running it.Can you help please.</p> <p>The error I am having:</p> <pre><code>11-16 16:30:23.043: E/AndroidRuntime(1709): FATAL EXCEPTION: main 11-16 16:30:23.043: E/AndroidRuntime(1709): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.intents/com.example.intents.MyBrowserActivity}: android.view.InflateException: Binary XML file line #7: Error inflating class webView </code></pre> <p>11-16 16:30:23.043: E/AndroidRuntime(1709): at Android.app.ActivityThread.performLaunchActivity(ActivityThread.Java:2059) 11-16 16:30:23.043: E/AndroidRuntime(1709): at Android.app.ActivityThread.handleLaunchActivity(ActivityThread.Java:2084)</p> <p>This is my manifest:</p> <pre><code>&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.intents" android:versionCode="1" android:versionName="1.0" &gt; &lt;uses-sdk android:minSdkVersion="8" android:targetSdkVersion="15" /&gt; &lt;uses-permission android:name="android.permission.CALL_PHONE"/&gt; &lt;uses-permission android:name="android.permission.INTERNET"/&gt; &lt;activity android:name=".MyBrowserActivity" android:label="@string/app_name" &gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.VIEW" /&gt; &lt;action android:name="com.example.MyBrowser" /&gt; &lt;category android:name="android.intent.category.DEFAULT" /&gt; &lt;data android:scheme="http"/&gt; &lt;/intent-filter&gt; &lt;/activity&gt; </code></pre> <p>Main Activity:</p> <pre><code>Button But4 = (Button)findViewById(R.id.btn_launchMyBrowser); But4.setOnClickListener(new View.OnClickListener(){ public void onClick(View v) { // TODO Auto-generated method stub Intent i = new Intent("com.example.MyBrowser"); i.setData(Uri.parse("http://www.amazon.com")); startActivity(i); } }); </code></pre> <p>My Intent Activity:</p> <pre><code> Uri url = getIntent().getData(); WebView webView = (WebView)findViewById(R.id.WebView01); webView.setWebViewClient(new Callback()); webView.loadUrl(url.toString()); } private class Callback extends WebViewClient { @Override public boolean shouldOverrideUrlLoading(WebView view, String url){ return (false); } } </code></pre>
    singulars
    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