use of com.dianping.example.fragment.SampleFragment in project AndroidDynamicLoader by mmin18.
the class FragmentDeveloper method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
FrameLayout rootView = new FrameLayout(this);
rootView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
rootView.setId(android.R.id.primary);
setContentView(rootView);
if (savedInstanceState == null) {
Fragment f = new SampleFragment();
FragmentManager fm = getFragmentManager();
FragmentTransaction ft = fm.beginTransaction();
ft.add(android.R.id.primary, f);
ft.commit();
}
}
Aggregations