Android XML can not create toggle button



I just started to learn android. I added a toggle button in my xml and I get error. But if I remove the toggle button error disappear. I found some solution here but nothing is working for me. Here is my code



<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://ift.tt/nIICcg"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >


<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id = "@+id/etCommands"
android:hint="Type a command"
android:password="true"
/>
<LinearLayout
android:weightSum="100"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<Button
android:layout_marginTop="45dp"
android:layout_weight="50"
android:id="@+id/bResults"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Button" />
<ToggleButton
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>

</LinearLayout>

<TextView
android:layout_marginTop="155dp"
android:id="@+id/tvResults"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="invalid" />

</LinearLayout>


and in graphical layout I get this error



Exception raised during rendering: -1
Exception details are logged in Window > Show View > Error LogThe graphics preview in the layout editor may not be accurate:
Different corner sizes are not supported in Path.addRoundRect. (Ignore for this session)
Path.isConvex is not supported. (Ignore for this session)

No comments:

Post a Comment