我有一個字符串輸入,其中包含一個帶String Fromat的Layout.xml。如何創建一個LayoutInflater給定XmlPullParser作爲輸入?
// String that contains the Layout.xml :
String concat ;
// Create the XmlPullParser from the String format
XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
factory.setNamespaceAware(true);
XmlPullParser xpp = factory.newPullParser();
xpp.setInput(new StringReader (concat));
// create le The LayoutInflater
LayoutInflater inflater = (LayoutInflater)this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View myView = inflater.inflate(xpp, null);
我有這個錯誤:
八月3日至12日:23:12.876:W/System.err的(937):android.view.InflateException: START_TAG HTTP://在java中的android:layout_height ='fill_parent'> @ 1:android:layout_width ='fill_parent' {http://schemas.android.com/apk/res/android} [email protected]:錯誤膨脹類
請幫忙嗎?