Question: ```
static void just_traverse(sll **head_ref) {
    sll *first = *head_ref;
    sll *second = (*head_ref)->next;

    if(second == NULL) {
            return;
    }

    just_traverse(&(second));
    *head_ref = second;
    printf("%d \t",second->payload);
}

```

In above code if I remove \*head\_ref = second; I get output with respect to stack however If I put this line \*head\_ref = second; It always print last element say {4,3,2,1} then it always prints 1?Can anybody explain why?

Answer: 
Firstly, you should be using `RelativeLayout`; [`FrameLayout`](http://developer.android.com/reference/android/widget/FrameLayout.html) is used to hold a single child element optimally.

Second, the layout is drawn in order from top to bottom -> back to front. Therefore you want your `Button` below it in the XML file.

Lastly, instead of `gravity` you should be using `align`.

```
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical" >

        <TextView
            android:id="@+id/textView1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Large Text"
            android:textAppearance="?android:attr/textAppearanceLarge" />
        <ListView 
            android:id="@+id/listView1"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content">

        </ListView>
    </LinearLayout>

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

</RelativeLayout>

```
Use Relative Layout, and then you can set your button position by `gravity` use this example add `layout_align` with different values, will do the trick for you.
 .....

```
<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent" >
<Button
    android:id="@+id/button1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom|right"
    android:text="Button" />

<ListView 
    android:id="@+id/listView1"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" />
</RelativeLayout>
......

```

Written Below are the margin properties you can use in your button code.

```
layout_alignParentBottom
layout_alignParentLeft 
layout_alignParentRight
layout_alignParentTop
layout_alignRight 
android:layout_alignTop 

```