preity dwivedi
preity dwivedi

Reputation: 1

issue when two SurfaceViews are created in relativelayout for android Kitkat

When i am trying to create two surfaceviews in one relative layout, one for local preview frame and other for remoteview, i am not able to see my local preview frames. Complete screen is used by remote view. It works fine for jellybean and below versions but does not work on kitkat.(I am working on a VideoCall application over IP) Here is the code snippet i am using:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:id="@+id/root_layout"
     android:layout_width="fill_parent"
     android:layout_height="fill_parent"
     android:background="#FFFFFF">
   <SurfaceView
     android:id="@+id/remote_surface"
     android:layout_height="fill_parent"
     android:layout_width="fill_parent"
     android:layout_alignParentTop="true"
     android:layout_alignParentRight="true"
     android:background="@drawable/layout_border"
   /> 
   <SurfaceView
    android:id="@+id/local_surface"
    android:layout_height="180px"
    android:layout_width="180px"
    android:layout_marginBottom="-4dip"
    android:layout_alignParentLeft="true"
    android:layout_above="@+id/swap_camera"
    android:background="@drawable/layout_border" 
  /> 
</Relativelayout>

Upvotes: 0

Views: 125

Answers (1)

Kent Hawkings
Kent Hawkings

Reputation: 2793

You've set the width of remote_surface to fill_parent so it is essentially covering the local_surface view. Put the line android:layout_above="@id/local_surface". That should work.

Upvotes: 1

Related Questions