Howdy, I searched for about 30 minutes to see if anyone had the same
issue but couldn't find anything.

I have a custom dialog I created with a relative layout, when the user
clicks on a button it brings up the dialog just fine normally.  I
added a few buttons to the dialog layout and this is where the trouble
begins. For some reason when I add an id to the third button, my I get
a runtime exception/force close dialog when my app starts up.  If the
third button has no id, the app works fine.  The other two buttons
already have id's and work great.
so in summary...

this layout works fine
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/
android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <Button
        android:id="@+id/cancel"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:text="Cancel" />
    <Button
        android:id="@+id/line"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:text="Line" />
    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_toRightOf="@id/line"
        android:text="Vehicle" />
</RelativeLayout>


and this one gives me a force close runtime exception when my app
starts
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/
android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <Button
        android:id="@+id/cancel"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:text="Cancel" />
    <Button
        android:id="@+id/line"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:text="Line" />
    <Button
        android:id="@+id/random"   <--------------------------------
this is the only difference between the two
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_toRightOf="@id/line"
        android:text="Vehicle" />
</RelativeLayout>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to