Two Questions About Master/detail Flow Template
Solution 1:
After much looking, the answer is because of this in values-large/refs.xml
<resources>
<item type="layout" name="activity_item_list">@layout/activity_item_twopane</item>
</resources>
It redirects the request for the normal layout to a larger layout (the two-pane version) where R.id.item_detail_container
is defined.
This is pretty obfuscated. I'm not sure why they didn't just call the large layout the same as the normal layout but then have different xml.
Solution 2:
with respect at your first question:
you need change in the class ItemListFragment
:
this:
setListAdapter(new ArrayAdapter<DummyContent.DummyItem>(getActivity(),
R.layout.simple_list_item_activated_1,
R.id.text1,
DummyContent.ITEMS));
for this:
setListAdapter(new ArrayAdapter<DummyContent.DummyItem>(getActivity(),
R.layout.simple_list_item_1,
R.id.text1,
DummyContent.ITEMS));
And comment in ItemDetailActivity
this line:
// getActionBar().setDisplayHomeAsUpEnabled(true);
Solution 3:
i think the Master/Detail Flow template requires api level 11 because it uses the Action Bar. I will try to use this template with ActionBarSherlcock and see if it works whit android 2.2 or 2.3.
Solution 4:
Regarding the first question, one reason that it requires V11 is that it's using list_content, and that's not included in the compatibility library. A work-around for that is here.
Solution 5:
The technique used in the second part of your question is an example of a Layout Alias.
Post a Comment for "Two Questions About Master/detail Flow Template"