Two-pane layout shows a single pane


I was only able to get the visual preview of the two panes after I added the following to my layout (using both API 19 on a RazrM, and API 21 on a Nexus 10 tablet):

<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="" android:orientation="horizontal" android:showDividers="middle" android:divider="?android:listDivider" android:dividerPadding="2.5dp" android:layout_width="match_parent" android:layout_height="match_parent"> </LinearLayout>

You can see the barely detectable divider (which actually looks like it is 1/4 of the way over, not 1/3 by the way):

However, when I run the app, the CrimeListFragment still takes up the entire screen:

Is this expected behavior?


Update - this was operator error. I inadvertently added the getLayoutResId() call to the findFragmentById() method, instead of setContentView()! Which of course, introduced a set of other problems (like my CrimeListFragment getting created over and over and over on configuration changes!).

Changing this to call the appropriate view works. Imagine that!