android screen with toggle button
<p>I am trying to create a screen with toggle buttons on it . I am using android2.2 . I am stumped by this exception feeling clueless.</p>

<p>I am posting my logs when that page is invoked ,and layout xml of the screen as well </p>

<p>my xml:</p>

<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;

&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
 android:layout_gravity="center_horizontal" android:id="@+id/postnatalcheck"  android:layout_width="fill_parent" android:layout_height="fill_parent" 
 android:background="#000000" android:paddingTop="10dip" android:paddingBottom="2dip"&gt;

&lt;Button 
    android:id="@+id/buttonBackHome" 
    android:text="Home" 
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentTop="true"/&gt; 

&lt;ScrollView  
    android:id="@+id/scrollviewpostnatal" 
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" 
    android:layout_marginTop="70dip"  
    android:layout_marginBottom="15dip"&gt;

&lt;LinearLayout 
    android:orientation="vertical" android:layout_height="fill_parent"
    android:layout_width="fill_parent" &gt;    


&lt;!-- This is Toggle button for PostNatal Check  --&gt;

 &lt;!--  this section is for Verbal examination Layout --&gt;

&lt;ToggleButton android:layout_width="fill_parent"
    android:layout_height="wrap_content" android:textOff="Mother Verbal Examination"
    android:textOn="Mother Verbal Examination" android:id="@+id/mverbalexamination"  /&gt;

&lt;LinearLayout  
    android:id="@+id/verexamination"
    android:orientation="vertical" android:layout_height="fill_parent"
    android:layout_marginLeft="25dip" android:layout_width="fill_parent" android:visibility="gone"&gt;

&lt;TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Number of full meals in a day " android:gravity="left" android:layout_gravity="left"/&gt; 

 &lt;Spinner
    android:id="@+id/noofmeals"
    android:layout_height="wrap_content"
    android:prompt="@string/Mealsaday"
    android:entries="@array/Numbers"
    android:layout_width="fill_parent"&gt;
&lt;/Spinner&gt;

&lt;TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Experience excessive bleeding" android:gravity="left" android:layout_gravity="left"/&gt;

&lt;Spinner
    android:id="@+id/excessivebleeding"
    android:layout_height="wrap_content"
    android:prompt="@string/Excessbleeding"
    android:entries="@array/Desicion"
    android:layout_width="fill_parent"&gt;
&lt;/Spinner&gt;

&lt;TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Number of pads changed in a day " android:gravity="left" android:layout_gravity="left"/&gt;


&lt;Spinner
    android:id="@+id/noofpadschange"
    android:layout_height="wrap_content"
    android:prompt="@string/Noofpadschanged"
    android:entries="@array/Numbers"
    android:layout_width="fill_parent"&gt;
&lt;/Spinner&gt;

&lt;TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Baby kept warm*(during winter especially )" android:gravity="left" android:layout_gravity="left"/&gt;

&lt;Spinner
    android:id="@+id/bwarm"
    android:layout_height="wrap_content"
    android:prompt="@string/Bwarm"
    android:entries="@array/Desicion"
    android:layout_width="fill_parent"&gt;
&lt;/Spinner&gt;

&lt;TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Number of time baby is fed in a day " android:gravity="left" android:layout_gravity="left"/&gt;


&lt;Spinner
    android:id="@+id/bfed"
    android:layout_height="wrap_content"
    android:prompt="@string/Bfed"
    android:entries="@array/Numbers"
    android:layout_width="fill_parent"&gt;
&lt;/Spinner&gt;

&lt;TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Baby crying incessantly" android:gravity="left" android:layout_gravity="left"/&gt;

&lt;Spinner
    android:id="@+id/bcrying"
    android:layout_height="wrap_content"
    android:prompt="@string/Bcrying"
    android:entries="@array/Desicion"
    android:layout_width="fill_parent"&gt;
&lt;/Spinner&gt;

&lt;TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Number of times baby urinating in a day " android:gravity="left" android:layout_gravity="left"/&gt;

&lt;Spinner
    android:id="@+id/burinating"
    android:layout_height="wrap_content"
    android:prompt="@string/Burinating"
    android:entries="@array/Numbers"
    android:layout_width="fill_parent"&gt;
&lt;/Spinner&gt;
&lt;/LinearLayout&gt;

 &lt;!--  this section is for Verbal examination Layout ends here --&gt;

&lt;!--  this section is for Physical examination starts here  --&gt; 
&lt;ToggleButton 
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" android:textOff="Mother Physical Examination"
    android:textOn="Mother Physical Examination" android:id="@+id/mphysicalexamination"  /&gt;

&lt;LinearLayout  
    android:id="@+id/phyexamination"
    android:orientation="vertical" android:layout_height="fill_parent"
    android:layout_marginLeft="25dip" android:layout_width="fill_parent" android:visibility="gone"&gt; 


&lt;TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Body temperature " android:gravity="left" android:layout_gravity="left"/&gt;

&lt;Spinner
    android:id="@+id/mtemperature"
    android:layout_height="wrap_content"
    android:prompt="@string/Mtemperature"
    android:entries="@array/Temperature"
    android:layout_width="fill_parent"&gt;
&lt;/Spinner&gt;

&lt;TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Discharge smells foul" android:gravity="left" android:layout_gravity="left"/&gt;

&lt;Spinner
    android:id="@+id/mdischargesmell"
    android:layout_height="wrap_content"
    android:prompt="@string/Mdischarge"
    android:entries="@array/Desicion"
    android:layout_width="fill_parent"&gt;
&lt;/Spinner&gt;

&lt;TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Speaks abnormaly" android:gravity="left" android:layout_gravity="left"/&gt;

&lt;Spinner
    android:id="@+id/mspeakingpattern"
    android:layout_height="wrap_content"
    android:prompt="@string/Mspeakingpattern"
    android:entries="@array/Desicion"
    android:layout_width="fill_parent"&gt;
&lt;/Spinner&gt;

&lt;TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Having fits " android:gravity="left" android:layout_gravity="left"/&gt;

&lt;Spinner
    android:id="@+id/mfits"
    android:layout_height="wrap_content"
    android:prompt="@string/Mfits"
    android:entries="@array/Desicion"
    android:layout_width="fill_parent"&gt;
&lt;/Spinner&gt;

&lt;TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Percieves less/no milk " android:gravity="left" android:layout_gravity="left"/&gt;

&lt;Spinner
    android:id="@+id/mbreastmilk"
    android:prompt="@string/Mbreastmilk"
    android:entries="@array/Desicion"
    android:layout_height="wrap_content"
    android:layout_width="fill_parent"&gt;
&lt;/Spinner&gt;

&lt;TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Cracked nipples " android:gravity="left" android:layout_gravity="left"/&gt;

&lt;Spinner
    android:id="@+id/mnipples"
    android:layout_height="wrap_content"
    android:prompt="@string/Mnipples"
    android:entries="@array/Desicion"
    android:layout_width="fill_parent"&gt;
&lt;/Spinner&gt;

&lt;TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Looks pale" android:gravity="left" android:layout_gravity="left"/&gt;

&lt;Spinner
    android:id="@+id/mskincolor"
    android:prompt="@string/Mskincolor"
    android:entries="@array/Desicion"
    android:layout_height="wrap_content"
    android:layout_width="fill_parent"&gt;
&lt;/Spinner&gt;

&lt;TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Vaginal tearing " android:gravity="left" android:layout_gravity="left"/&gt;

&lt;Spinner
    android:id="@+id/mvaginatearing"
    android:entries="@string/Mvaginaltearing"
    android:prompt="@array/Desicion"
    android:layout_height="wrap_content"
    android:layout_width="fill_parent"&gt;
&lt;/Spinner&gt;
&lt;/LinearLayout&gt;


&lt;!--  this section of physical examination ends here  --&gt; 











        &lt;TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="" android:gravity="left" android:layout_gravity="left"/&gt;
        &lt;TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="" android:gravity="left" android:layout_gravity="left"/&gt;
        &lt;TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="" android:gravity="left" android:layout_gravity="left"/&gt;
        &lt;TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="" android:gravity="left" android:layout_gravity="left"/&gt;
        &lt;TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="" android:gravity="left" android:layout_gravity="left"/&gt;
        &lt;TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="" android:gravity="left" android:layout_gravity="left"/&gt;
        &lt;TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="" android:gravity="left" android:layout_gravity="left"/&gt;


        &lt;Button 
            android:id="@+id/buttonAdvisoryandSave" 
            android:text="Register" 
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"/&gt;


&lt;/LinearLayout&gt;


&lt;/ScrollView&gt;

&lt;TextView 
    android:id="@+id/copyrighted" 
    android:layout_width="wrap_content" 
    android:layout_centerInParent="true"
    android:layout_height="wrap_content" 
    android:layout_alignParentBottom="true" 
    style="@style/copyrighted" 
    android:layout_below="@+id/rlinner" 
    android:text="@string/copyrighted" 
    android:textColor="#FFFFFF"/&gt;

&lt;/RelativeLayout&gt;
</code></pre>

<p>my logtrace :</p>

<pre><code>/AndroidRuntime(  356): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.accenturelabs.idoc/com.accenturelabs.id
c.PostNatalCheck}: android.view.InflateException: Binary XML file line #198: Error inflating class &lt;unknown&gt;
/AndroidRuntime(  356):        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
/AndroidRuntime(  356):        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
/AndroidRuntime(  356):        at android.app.ActivityThread.access$2300(ActivityThread.java:125)
/AndroidRuntime(  356):        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
/AndroidRuntime(  356):        at android.os.Handler.dispatchMessage(Handler.java:99)
/AndroidRuntime(  356):        at android.os.Looper.loop(Looper.java:123)
/AndroidRuntime(  356):        at android.app.ActivityThread.main(ActivityThread.java:4627)
/AndroidRuntime(  356):        at java.lang.reflect.Method.invokeNative(Native Method)
/AndroidRuntime(  356):        at java.lang.reflect.Method.invoke(Method.java:521)
/AndroidRuntime(  356):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
/AndroidRuntime(  356):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
/AndroidRuntime(  356):        at dalvik.system.NativeStart.main(Native Method)
/AndroidRuntime(  356): Caused by: android.view.InflateException: Binary XML file line #198: Error inflating class &lt;unknown&gt;
/AndroidRuntime(  356):        at android.view.LayoutInflater.createView(LayoutInflater.java:513)
/AndroidRuntime(  356):        at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
/AndroidRuntime(  356):        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
/AndroidRuntime(  356):        at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
/AndroidRuntime(  356):        at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)
/AndroidRuntime(  356):        at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)
/AndroidRuntime(  356):        at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)
/AndroidRuntime(  356):        at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
/AndroidRuntime(  356):        at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
/AndroidRuntime(  356):        at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
/AndroidRuntime(  356):        at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
/AndroidRuntime(  356):        at android.app.Activity.setContentView(Activity.java:1647)
/AndroidRuntime(  356):        at com.accenturelabs.idoc.PostNatalCheck.onCreate(PostNatalCheck.java:39)
/AndroidRuntime(  356):        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
/AndroidRuntime(  356):        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
/AndroidRuntime(  356):        ... 11 more
/AndroidRuntime(  356): Caused by: java.lang.reflect.InvocationTargetException
/AndroidRuntime(  356):        at android.widget.Spinner.&lt;init&gt;(Spinner.java:49)
/AndroidRuntime(  356):        at java.lang.reflect.Constructor.constructNative(Native Method)
/AndroidRuntime(  356):        at java.lang.reflect.Constructor.newInstance(Constructor.java:446)
/AndroidRuntime(  356):        at android.view.LayoutInflater.createView(LayoutInflater.java:500)
/AndroidRuntime(  356):        ... 25 more
/AndroidRuntime(  356): Caused by: java.lang.NullPointerException
/AndroidRuntime(  356):        at android.content.res.AssetManager.getResourceTextArray(AssetManager.java:213)
/AndroidRuntime(  356):        at android.content.res.Resources.getTextArray(Resources.java:361)
/AndroidRuntime(  356):        at android.content.res.TypedArray.getTextArray(TypedArray.java:628)
/AndroidRuntime(  356):        at android.widget.AbsSpinner.&lt;init&gt;(AbsSpinner.java:73)
/AndroidRuntime(  356):        at android.widget.Spinner.&lt;init&gt;(Spinner.java:53)
/AndroidRuntime(  356):        ... 29 more
/ActivityManager(   58):   Force finishing activity com.accenturelabs.idoc/.PostNatalCheck
/ActivityManager(   58): Activity pause timeout for HistoryRecord{45030968 com.accenturelabs.idoc/.PostNatalCheck}
/Process (  356): Sending signal. PID: 356 SIG: 9
/ActivityManager(   58): Process com.accenturelabs.idoc (pid 356) has died.
/ActivityManager(   58): Scheduling restart of crashed service com.accenturelabs.idoc/.LocalService in 5000ms
</code></pre>
