0
votes

On my previous xml code my app was running correctly:

     <?xml version="1.0" encoding="utf-8"?>
   <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
   android:layout_width="match_parent"
   android:layout_height="match_parent"
   android:orientation="vertical" >

    <RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="82dp" >

    <EditText
        android:id="@+id/editText1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        android:layout_toLeftOf="@+id/button1"
        android:ems="10" >

        <requestFocus />
    </EditText>

    <Button
        android:id="@+id/button1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_alignParentRight="true"
        android:text="Send" />

          </RelativeLayout>

        <ListView
     android:id="@android:id/list"
     android:layout_width="match_parent"
     android:layout_height="380dp" />


     </LinearLayout>

Now when I changed my xml ,and now when I make relative layout or frame layout as a parent my app gives me error "unfortunately it is stopped", My new xml is:

  <?xml version="1.0" encoding="utf-8"?>
   <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
 android:layout_width="match_parent"
 android:layout_height="match_parent" >

      <RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="86dp"
    android:layout_gravity="bottom" >

    <Button
        android:id="@+id/button1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_alignParentRight="true"
        android:text="Send" />

    <EditText
        android:id="@+id/editText1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        android:layout_toLeftOf="@+id/button1"
        android:ems="10" />

  </RelativeLayout>

  <ListView
    android:id="@+id/listView1"
    android:layout_width="match_parent"
    android:layout_height="372dp" >
  </ListView>

        </FrameLayout>

Logcat:

08-24 19:08:24.050: E/AndroidRuntime(674): at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:809) 08-24 19:08:24.050: E/AndroidRuntime(674): at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:998) 08-24 19:08:24.050: E/AndroidRuntime(674): at android.app.BackStackRecord.run(BackStackRecord.java:622) 08-24 19:08:24.050: E/AndroidRuntime(674): at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1330) 08-24 19:08:24.050: E/AndroidRuntime(674): at android.app.Activity.performStart(Activity.java:4474) 08-24 19:08:24.050: E/AndroidRuntime(674): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1928) 08-24 19:08:24.050: E/AndroidRuntime(674): ... 11 more

2
Did you change it manually?meda
Have you read about frame layout first? Follow the link developer.android.com/reference/android/widget/FrameLayout.html I want to know your requirement to use the frame layout here? Post log trace as well.Jatin Malwal
Post your logcat error .Rahul
Your layout is working fine in my emulator. May be you doing something wrong in your Java class.Rahul
I have edited my question with complete log cat error detail ,please check,Ameer Humza

2 Answers

1
votes

Change your ListView id, If you Extending ListActivity must specify the keyword android.

 <ListView
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="372dp" >
</ListView>
0
votes

Sorry Ameer Humza, But I did not get such an error while executing both your xmls.

I think you should try cleaning your project first: Project > Clean.

or

Restart your Eclipse.

What is the version of your eclipse?