Honeycomb中的WebView获取Signal 11

时间:2011-02-08 16:39:10

标签: android webview emulation

如果我在Honycomb预览SDK中运行以下,我会遇到信号11

package com.android.samples;

import android.app.Activity;
import android.os.Bundle;
import android.view.Window;
import android.webkit.WebChromeClient;
import android.webkit.WebView;

public class MyWebView extends Activity {
WebView mWebView;         
/** Called when the activity is first created. */   
@Override   
public void onCreate(Bundle savedInstanceState)     {       
    super.onCreate(savedInstanceState);               
    // Adds Progrss bar Support       
    this.getWindow().requestFeature(Window.FEATURE_PROGRESS);       
    setContentView(R.layout.main );               
    // Makes Progress bar Visible       
    getWindow().setFeatureInt( Window.FEATURE_PROGRESS, Window.PROGRESS_VISIBILITY_ON);           
    // Get Web view        
    mWebView = (WebView) findViewById( R.id.MyWebview ); 
    //This is the id you gave                                                
    //to the WebView in the main.xml        
    mWebView.getSettings().setJavaScriptEnabled(true);           
    //mWebView.getSettings().setSupportZoom(true);       
    //Zoom Control on web (You don't need this                                                
    //if ROM supports Multi-Touch              
    mWebView.getSettings().setBuiltInZoomControls(true); //Enable Multitouch if supported by ROM                
    //Load URL        
    mWebView.loadUrl("http://www.google.com");
    // Sets the Chrome Client, and defines the onProgressChanged        
    // This makes the Progress bar be updated.        
    final Activity MyActivity = this;        
    mWebView.setWebChromeClient(new WebChromeClient() {         
        public void onProgressChanged(WebView view, int progress)            {          
            //Make the bar disappear after URL is loaded, and changes string to Loading...          
            MyActivity.setTitle("Loading...");          
            MyActivity.setProgress(progress * 100); 
            //Make the bar disappear after URL is loaded            
            // Return the app name after finish loading             
            if(progress == 100)                
                MyActivity.setTitle(R.string.app_name);           
            }         
        });                               
} 
//End of Method onCreate
} 

这是我的main.xml布局

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"      
          android:orientation="vertical"      
          android:layout_width="fill_parent"      
          android:layout_height="fill_parent" >     
<WebView  android:id="@+id/MyWebview"      
          android:layout_width="fill_parent"      
          android:layout_height="fill_parent" /> 
</LinearLayout> 

如果我切换到说2.2或2.3模拟器,这运行正常,但在3.0模拟器中运行在logcat中给出类似的东西

02-07 20:53:11.740: INFO/DEBUG(1399): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
02-07 20:53:11.740: INFO/DEBUG(1399): Build fingerprint: 'generic/sdk/generic:Honeycomb/HPI20B/eng.xav.20110125.162619:eng/test-keys'
02-07 20:53:11.768: INFO/DEBUG(1399): pid: 1429, tid: 1451  >>> com.android.samples <<<
02-07 20:53:11.768: INFO/DEBUG(1399): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr caccecb8
02-07 20:53:11.768: INFO/DEBUG(1399):  r0 caa137c0  r1 000000c4  r2 00000008  r3 002bb4f8

到目前为止,我找不到任何解决方法。 知道我应该做些什么来让这个工作吗?

1 个答案:

答案 0 :(得分:0)

这似乎是一个已知问题

您可以阅读this