Here's what I was trying, but it gives me an InflateException
Using java Syntax Highlighting
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- LayoutInflater inflater = getLayoutInflater();
- XmlPullParser parser=null;
- try {
- XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
- parser=factory.newPullParser();
- // Utils just provides a layout xml as InputStream
- Utils utils = new Utils(this);
- parser.setInput(utils.getLayoutAsInputStream(), null);
- } catch (XmlPullParserException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- inflater.inflate(parser, null);
- }
Parsed in 0.033 seconds, using GeSHi 1.0.8.4
layout xml
Using xml Syntax Highlighting
- <?xml version="1.0" encoding="utf-8"?>
- <RelativeLayout
- android:id="@+id/widget29"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- xmlns:android="http://schemas.android.com/apk/res/android"
- >
- <ImageView
- android:id="@+id/widget73"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:src="@drawable/boot_robot"
- android:layout_centerVertical="true"
- android:layout_centerHorizontal="true"
- >
- </ImageView>
- <Button
- android:id="@+id/widget33"
- android:layout_width="150px"
- android:layout_height="wrap_content"
- android:text="Blue Pill"
- android:layout_alignParentBottom="true"
- android:layout_alignParentRight="true"
- >
- </Button>
- <Button
- android:id="@+id/widget32"
- android:layout_width="150px"
- android:layout_height="wrap_content"
- android:text="Red Pill"
- android:layout_alignParentBottom="true"
- android:layout_alignParentLeft="true"
- >
- </Button>
- </RelativeLayout>
Parsed in 0.004 seconds, using GeSHi 1.0.8.4

