Linear Layout over relative layout

Posted by Sai on Stack Overflow See other posts from Stack Overflow or by Sai
Published on 2012-07-03T03:11:27Z Indexed on 2012/07/03 3:15 UTC
Read the original article Hit count: 481

Filed under:
|

I have a relative layout for Camera preview with some overlay features. The layout file looks like the one in shown below:

    <?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"
    >
<android.view.SurfaceView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/preview"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
</android.view.SurfaceView>
</RelativeLayout>

I integrated some menu options from the android bluetooth chat example. The menu options work fine but if I click on one of the options, the app just froze. It opens a debug perspective but I am not able to understand them.

The app does not seem to crash but it just froze. The layout that I am using for the menu options is:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
>

<TextView android:id="@+id/title_paired_devices"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:text="@string/title_paired_devices"
    android:visibility="gone"
    android:textColor="#fff"
    android:paddingLeft="5dp"
/>
<ListView android:id="@+id/paired_devices"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:stackFromBottom="true"
    android:layout_weight="1"
/>
<TextView android:id="@+id/title_new_devices"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:text="@string/title_other_devices"
    android:visibility="gone"
    android:textColor="#fff"
    android:paddingLeft="5dp"
/>
<ListView android:id="@+id/new_devices"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:stackFromBottom="true"
    android:layout_weight="2"
/>

Can I attribute this to the fact that I am trying to overlay Linear layout over relative layout? Any suggestions to display the list of bluetooth devices over camera preview would be greatly appreciated

© Stack Overflow or respective owner

Related posts about android

Related posts about android-layout