フラグメント内にCordovaWebView(2.2.0)を実装しようとしていますが、レイアウトを膨らませようとするとエラーが返されます。
私のxml:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<org.apache.cordova.CordovaWebView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id = "@+id/mainView"/>
</FrameLayout>
私のonCreateView:
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.cordovawebview, container); // <--- the error occurs here!
return v;
}
エラー:
10-25 15:52:02.839:ERROR / AndroidRuntime(2878):FATAL EXCEPTION:main android.view.InflateException:Binary XML file line#21:Error inflating class org.apache.cordova.CordovaWebView NullPointerException CordovaWebView.java line 691
int id = getResources().getIdentifier("config", "xml", this.cordova.getActivity().getPackageName());
ここではリソースがnullのようです。
私はすでにそれをチェックしました、そして、config.xmlファイルはxmlフォルダーにあります。
FragmentActivityに実装できますが、Fragmentに必要です。
何か案は?
前もって感謝します。