i'm using phonegap "2.0" with Android SDK 15, i just want to Embedding Cordova WebView on Android prject, i used step by step the guide Links, also another example in github Links my app crashed and stoped automatically when I run. Logcat error :
android.view.InflateException: Binary XML file line #6: Error inflating class org.apache.cordova.CordovaWebView
my xml file "main.xml":
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent">
<org.apache.cordova.CordovaWebView android:id="@+id/phoneGapView" android:layout_width="fill_parent" android:layout_height="fill_parent" />
</LinearLayout >
Thx in advance.. :)
You may have the same error as I did. Once I implemented the methods derived from CordovaInterface in my activity, in particular the getActivity method, the application started just fine.
@Override
public Activity getActivity() {
return this;
}
Note that the default implementation returns null while the CordovaWebView most likely requires a proper Activity instance for its initialization.
Note: I am using PhoneGap 2.1.0
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With