diff --git a/api/current.xml b/api/current.xml index d261a9747fa78..b79e6d1cf790c 100644 --- a/api/current.xml +++ b/api/current.xml @@ -139228,6 +139228,17 @@ visibility="public" > + + + + + + + + outerDepth)) { if (type == XmlPullParser.END_TAG || type == XmlPullParser.TEXT) { @@ -524,7 +547,27 @@ public abstract class PreferenceActivity extends ListActivity implements if (curBundle == null) { curBundle = new Bundle(); } - getResources().parseBundleExtras(parser, curBundle); + + final int innerDepth = parser.getDepth(); + while ((type=parser.next()) != XmlPullParser.END_DOCUMENT + && (type != XmlPullParser.END_TAG || parser.getDepth() > innerDepth)) { + if (type == XmlPullParser.END_TAG || type == XmlPullParser.TEXT) { + continue; + } + + String innerNodeName = parser.getName(); + if (innerNodeName.equals("extra")) { + getResources().parseBundleExtra("extra", attrs, curBundle); + XmlUtils.skipCurrentTag(parser); + + } else if (innerNodeName.equals("intent")) { + header.intent = Intent.parseIntent(getResources(), parser, attrs); + + } else { + XmlUtils.skipCurrentTag(parser); + } + } + if (curBundle.size() > 0) { header.fragmentArguments = curBundle; curBundle = null; @@ -546,6 +589,16 @@ public abstract class PreferenceActivity extends ListActivity implements } + /** + * Set a footer that should be shown at the bottom of the header list. + */ + public void setListFooter(View view) { + mListFooter.removeAllViews(); + mListFooter.addView(view, new FrameLayout.LayoutParams( + FrameLayout.LayoutParams.MATCH_PARENT, + FrameLayout.LayoutParams.WRAP_CONTENT)); + } + @Override protected void onStop() { super.onStop(); @@ -633,10 +686,14 @@ public abstract class PreferenceActivity extends ListActivity implements * @param position The header's position in the list. */ public void onHeaderClick(Header header, int position) { - if (mSinglePane) { - startWithFragment(header.fragment, header.fragmentArguments); - } else { - switchToHeader(header.fragment, header.fragmentArguments); + if (header.fragment != null) { + if (mSinglePane) { + startWithFragment(header.fragment, header.fragmentArguments); + } else { + switchToHeader(header.fragment, header.fragmentArguments); + } + } else if (header.intent != null) { + startActivity(header.intent); } } diff --git a/core/res/res/layout/preference_list_content.xml b/core/res/res/layout/preference_list_content.xml index eeba18e743ca4..fe950b25eb619 100644 --- a/core/res/res/layout/preference_list_content.xml +++ b/core/res/res/layout/preference_list_content.xml @@ -29,12 +29,25 @@ android:layout_height="0px" android:layout_weight="1"> - + android:layout_weight="1"> + + + + + +