Follow API changes.
Change-Id: Ieb1df7fc0708f22aae3d851f74ade1343eb44e08
This commit is contained in:
@@ -41,7 +41,7 @@ public class FragmentContextMenu extends Activity {
|
||||
|
||||
// Create the list fragment and add it as our sole content.
|
||||
ContextMenuFragment content = new ContextMenuFragment();
|
||||
getFragmentManager().openTransaction().add(android.R.id.content, content).commit();
|
||||
getFragmentManager().beginTransaction().add(android.R.id.content, content).commit();
|
||||
}
|
||||
|
||||
public static class ContextMenuFragment extends Fragment {
|
||||
|
||||
@@ -70,7 +70,7 @@ public class FragmentDialog extends Activity {
|
||||
// DialogFragment.show() will take care of adding the fragment
|
||||
// in a transaction. We also want to remove any currently showing
|
||||
// dialog, so make our own transaction and take care of that here.
|
||||
FragmentTransaction ft = getFragmentManager().openTransaction();
|
||||
FragmentTransaction ft = getFragmentManager().beginTransaction();
|
||||
Fragment prev = getFragmentManager().findFragmentByTag("dialog");
|
||||
if (prev != null) {
|
||||
ft.remove(prev);
|
||||
|
||||
@@ -39,7 +39,7 @@ public class FragmentDialogOrActivity extends Activity {
|
||||
if (savedInstanceState == null) {
|
||||
// First-time init; create fragment to embed in activity.
|
||||
//BEGIN_INCLUDE(embed)
|
||||
FragmentTransaction ft = getFragmentManager().openTransaction();
|
||||
FragmentTransaction ft = getFragmentManager().beginTransaction();
|
||||
DialogFragment newFragment = MyDialogFragment.newInstance();
|
||||
ft.add(R.id.embedded, newFragment);
|
||||
ft.commit();
|
||||
|
||||
@@ -51,7 +51,7 @@ public class FragmentHideShow extends Activity {
|
||||
final Button button = (Button)findViewById(buttonId);
|
||||
button.setOnClickListener(new OnClickListener() {
|
||||
public void onClick(View v) {
|
||||
FragmentTransaction ft = getFragmentManager().openTransaction();
|
||||
FragmentTransaction ft = getFragmentManager().beginTransaction();
|
||||
ft.setCustomAnimations(android.R.animator.fade_in,
|
||||
android.R.animator.fade_out);
|
||||
if (fragment.isHidden()) {
|
||||
|
||||
@@ -74,7 +74,7 @@ public class FragmentLayout extends Activity {
|
||||
// During initial setup, plug in the details fragment.
|
||||
DetailsFragment details = new DetailsFragment();
|
||||
details.setArguments(getIntent().getExtras());
|
||||
getFragmentManager().openTransaction().add(android.R.id.content, details).commit();
|
||||
getFragmentManager().beginTransaction().add(android.R.id.content, details).commit();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -150,11 +150,9 @@ public class FragmentLayout extends Activity {
|
||||
|
||||
// Execute a transaction, replacing any existing fragment
|
||||
// with this one inside the frame.
|
||||
FragmentTransaction ft = getFragmentManager().openTransaction();
|
||||
FragmentTransaction ft = getFragmentManager().beginTransaction();
|
||||
ft.replace(R.id.details, df);
|
||||
ft.setTransition(index > mCurCheckPosition
|
||||
? FragmentTransaction.TRANSIT_FRAGMENT_NEXT
|
||||
: FragmentTransaction.TRANSIT_FRAGMENT_PREV);
|
||||
ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
|
||||
ft.commit();
|
||||
mShownCheckPosition = index;
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ public class FragmentListArray extends Activity {
|
||||
// Create the list fragment and add it as our sole content.
|
||||
if (getFragmentManager().findFragmentById(android.R.id.content) == null) {
|
||||
ArrayListFragment list = new ArrayListFragment();
|
||||
getFragmentManager().openTransaction().add(android.R.id.content, list).commit();
|
||||
getFragmentManager().beginTransaction().add(android.R.id.content, list).commit();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ public class FragmentListCursorLoader extends Activity {
|
||||
// Create the list fragment and add it as our sole content.
|
||||
if (fm.findFragmentById(android.R.id.content) == null) {
|
||||
CursorLoaderListFragment list = new CursorLoaderListFragment();
|
||||
fm.openTransaction().add(android.R.id.content, list).commit();
|
||||
fm.beginTransaction().add(android.R.id.content, list).commit();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ public class FragmentMenu extends Activity {
|
||||
|
||||
// Make sure the two menu fragments are created.
|
||||
FragmentManager fm = getFragmentManager();
|
||||
FragmentTransaction ft = fm.openTransaction();
|
||||
FragmentTransaction ft = fm.beginTransaction();
|
||||
mFragment1 = fm.findFragmentByTag("f1");
|
||||
if (mFragment1 == null) {
|
||||
mFragment1 = new MenuFragment();
|
||||
@@ -69,7 +69,7 @@ public class FragmentMenu extends Activity {
|
||||
|
||||
// Update fragment visibility based on current check box state.
|
||||
void updateFragmentVisibility() {
|
||||
FragmentTransaction ft = getFragmentManager().openTransaction();
|
||||
FragmentTransaction ft = getFragmentManager().beginTransaction();
|
||||
if (mCheckBox1.isChecked()) ft.show(mFragment1);
|
||||
else ft.hide(mFragment1);
|
||||
if (mCheckBox2.isChecked()) ft.show(mFragment2);
|
||||
|
||||
@@ -31,7 +31,7 @@ public class FragmentReceiveResult extends Activity {
|
||||
if (savedInstanceState == null) {
|
||||
// Do first time initialization -- add fragment.
|
||||
Fragment newFragment = new ReceiveResultFragment();
|
||||
FragmentTransaction ft = getFragmentManager().openTransaction();
|
||||
FragmentTransaction ft = getFragmentManager().beginTransaction();
|
||||
ft.add(R.id.simple_fragment, newFragment).commit();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ public class FragmentRetainInstance extends Activity {
|
||||
|
||||
// First time init, create the UI.
|
||||
if (savedInstanceState == null) {
|
||||
getFragmentManager().openTransaction().add(android.R.id.content,
|
||||
getFragmentManager().beginTransaction().add(android.R.id.content,
|
||||
new UiFragment()).commit();
|
||||
}
|
||||
}
|
||||
@@ -84,7 +84,7 @@ public class FragmentRetainInstance extends Activity {
|
||||
mWorkFragment = new RetainedFragment();
|
||||
// Tell it who it is working with.
|
||||
mWorkFragment.setTargetFragment(this, 0);
|
||||
fm.openTransaction().add(mWorkFragment, "work").commit();
|
||||
fm.beginTransaction().add(mWorkFragment, "work").commit();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ public class FragmentStack extends Activity {
|
||||
if (savedInstanceState == null) {
|
||||
// Do first time initialization -- add initial fragment.
|
||||
Fragment newFragment = CountingFragment.newInstance(mStackLevel);
|
||||
FragmentTransaction ft = getFragmentManager().openTransaction();
|
||||
FragmentTransaction ft = getFragmentManager().beginTransaction();
|
||||
ft.add(R.id.simple_fragment, newFragment).commit();
|
||||
} else {
|
||||
mStackLevel = savedInstanceState.getInt("level");
|
||||
@@ -70,7 +70,7 @@ public class FragmentStack extends Activity {
|
||||
|
||||
// Add the fragment to the activity, pushing this transaction
|
||||
// on to the back stack.
|
||||
FragmentTransaction ft = getFragmentManager().openTransaction();
|
||||
FragmentTransaction ft = getFragmentManager().beginTransaction();
|
||||
ft.replace(R.id.simple_fragment, newFragment);
|
||||
ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
|
||||
ft.addToBackStack(null);
|
||||
|
||||
@@ -376,7 +376,7 @@ public class LoaderThrottle extends Activity {
|
||||
// Create the list fragment and add it as our sole content.
|
||||
if (fm.findFragmentById(android.R.id.content) == null) {
|
||||
ThrottledLoaderListFragment list = new ThrottledLoaderListFragment();
|
||||
fm.openTransaction().add(android.R.id.content, list).commit();
|
||||
fm.beginTransaction().add(android.R.id.content, list).commit();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user