The detail container view will be present only in the // large-screen layouts (res/values-large and // res/values-sw600dp). If this view is present, then the // activity should be in two-pane mode. mTwoPane = true; ... code specific to two pane layout }
/* add the Fragments to the ViewPagerAdapter */ for(String title : mPuppyTitles) { adapter.addFrag(PuppyFragment.newInstance(index++), title); } mViewPager.setAdapter(adapter);
FragmentTransaction transaction = fragmentManager.beginTransaction(); // do replace, add to backstack and commit operation transaction.replace(R.id.detail_container, fragment) .addToBackStack(“details”) // optional name for this back stack state, or null .commit();
other methods and implementation not shown @Override public void onDialogDismissed(String whichSalutation) { if (whichSalutation.equals(SampleDialogFragment.GOODBYE)) { Toast.makeText(this, "Thank you!", Toast.LENGTH_SHORT).show(); } } }