FragmentTransaction can't replace fragment working with ABS
I have an activity called HomeActivity,
{
public class HomeActivity extends SherlockFragmentActivity
}
but the code below here
{
private void selectItem(int position) {
FragmentTransaction ft =
getSupportFragmentManager().beginTransaction();
// Locate Position
switch (position) {
case 0:
ft.replace(R.id.content_frame, home);
break;
case 1:
ft.replace(R.id.content_frame, gadget);
break;
case 2:
ft.replace(R.id.content_frame, news);
break;
case 3:
ft.replace(R.id.content_frame, techno);
break;
case 4:
ft.replace(R.id.content_frame, game);
break;
case 5:
ft.replace(R.id.content_frame, tips);
break;
case 6:
ft.replace(R.id.content_frame, cgt);
break;
case 7:
ft.replace(R.id.content_frame, info);
break;
}
ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
ft.commit();
mDrawerList.setItemChecked(position, true);
// Close drawer
mDrawerLayout.closeDrawer(mDrawerList);
}
}
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
the FragmentTransaction can't replace my fragment in
SherlockFragmentActivity.
I have no idea with this, I search and implements some method from google
and stackoverflow but my issue still not sot please I need a hint with
this..thanks
No comments:
Post a Comment