Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid 2.2 WebView crashing in xml layout
    primarykey
    data
    text
    <p>I have a small application that displays a TabHost at launch. One of the TabHost tabs is an Activity which loads a web page inside a WebView with the following code:</p> <pre><code>reusableIntent = new Intent().setClass(this, ForumViewActivity.class); tabHost.addTab(tabHost.newTabSpec("Forum").setContent(reusableIntent).setIndicator(this.getString(R.string.forum))); </code></pre> <p>And inside the ForumViewActivity.class, this is what happens:</p> <pre><code>setContentView(R.layout.forum); browser = (WebView) findViewById(R.id.forumwebviewbrowser); loadingDialog = ProgressDialog.show(ForumViewActivity.this, "", "Loading...", false); loadingDialog.setCancelable(true); loadingDialog.setCanceledOnTouchOutside(true); browser.loadUrl("http://forum.aulacremona.com/"); </code></pre> <p><i>forum.xml</i> is just the definition of a LinearLayout that hosts a WebView called '<i>forumwebviewbrowser</i>', which I call on.</p> <p>My problem is: when switching between tabs, i.e. back and forth to and from my "Forum" tab, the application will crash, as in go back to Android desktop/launcher.</p> <p>If I use the aforementioned method, in which I define the layour in an external .xml file ( the way Google explains it when using WebView ), the app will crash as soon as I switch off the Forum tab and reeneter it; instead, if I define a WebView object inside my class without any xml external resource file, the app will crash after way more retries ( I have to switch in and out the tab more times ).</p> <p>I have no errors at all in the debugger. Just the warnings:</p> <blockquote> <p>03-09 11:00:32.765: WARN/InputManagerService(52): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@44dc6920</p> <p>03-09 11:00:35.714: WARN/InputManagerService(52): Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@44cb1428 (uid=10024 pid=685)</p> <p>03-09 11:00:35.925: WARN/ActivityManager(52): Duplicate finish request for HistoryRecord{44d7a978 com.tesi.Myappname/.Myappname}</p> </blockquote> <p>That doesn't justify the crash at all. Any suggestions? I really can't understand why I should drive away from the xml-defined layout, and besides that this problem is driving me nuts.</p> <p><em>edit</em></p> <p>Besides that, I am working offline. I have tried to pass to the browser the string reperesenting HTML of an empty page, and I can't get it to visualize anything. This is really weird.</p>
    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.
 

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