Update to follow fragment API changes.

Also make use of fragment arguments and targets to simplify code.

Change-Id: I79884854f4c7ff4fdc35c68087b5b2235a75c79f
This commit is contained in:
Dianne Hackborn
2010-08-15 12:49:50 -07:00
parent b880eb4260
commit 9e6f12a598
15 changed files with 72 additions and 30 deletions

View File

@@ -21,6 +21,7 @@ import com.example.android.apis.R;
import android.os.Bundle;
import android.preference.PreferenceActivity;
import android.preference.PreferenceFragment;
import android.util.Log;
import java.util.List;
@@ -60,6 +61,9 @@ public class PreferenceWithHeaders extends PreferenceActivity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Can retrieve arguments from preference XML.
Log.i("args", "Arguments: " + getArguments());
// Load the preferences from an XML resource
addPreferencesFromResource(R.xml.fragmented_preferences_inner);
}
@@ -73,6 +77,9 @@ public class PreferenceWithHeaders extends PreferenceActivity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Can retrieve arguments from headers XML.
Log.i("args", "Arguments: " + getArguments());
// Load the preferences from an XML resource
addPreferencesFromResource(R.xml.preference_dependencies);
}