2012-11-13 5 views
2

je tente de mettre en œuvre CordovaWebView dans une activité, mais je reçois l'erreur suivante:Comment mettre en œuvre CordovaWebView une activité

android.view.InflateException: Binary XML file line #12: Error inflating class 
org.apache.cordova.CordovaWebView 

Voici mon code:

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

<!-- TextView 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:text="@string/hello" /--> 

<org.apache.cordova.CordovaWebView 
    android:id="@+id/tutorialView" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" /> 

</LinearLayout> 

et:

public class NewActivity extends Activity implements CordovaInterface { 

CordovaWebView cwv; 

@Override 
protected void onCreate(Bundle savedInstanceState) { 
    // TODO Auto-generated method stub 
    super.onCreate(savedInstanceState); 
    setContentView(R.layout.main); 

    cwv = (CordovaWebView) findViewById(R.id.tutorialView); 
    cwv.loadUrl("file:///android_asset/www/index.html"); 
} 
} 

Ma version de Phonegap est 2.2.0 Quelqu'un peut-il dire pourquoi cela se passe?

merci à l'avance

Kobi

+0

Avez-vous regardez l'exemple de Joe? https://github.com/infil00p/CordovaActionView –

+0

En outre, il doit y avoir un * lot * de plus pour cette trace de pile qu'une seule ligne. – CommonsWare

+0

Est-ce possible d'obtenir le CordovaWebview sans mise en page xml. c'est-à-dire WebView CordovaWebview = nouveau CordovaWebview (ceci); webview.loadurl ("un peu d'url"); – Karthick

Répondre

Questions connexes