Fragment 子类:DialogFragment ; ListFragment ; PreferenceFragment
onCreate
public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle saveInstanceState){
return inflater.inflater(R.layout.xxx,container,false);
}
onPause
* Fragment 添加到一个已存存的ViewGroup
FragmentManager fragmentManager = getFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
XXXFragment fragment = new xxxFragment();
fragmentTransaction.add(R.id.xxxViewGroup,fragment);//or replace addToBackStack(null);
fragmentTransaction.commit();
getActivity() //从fragment 取的activity
getFragmentManager().findFragmentById(R.id.xxxfragment);//从activity 取的fragment
*actionBar
ActionBar actionBar = getActionBar();
actionBar.hide();
onCreateOptionMenu() 生成actionBAR 和浮动式菜单