8

The first activity contains a Fragment, and there's a button inside the fragment, and when I click this button, I wish to jump to a new Activity with different animation. So I do it like this in the Fragment:

          mButton.setOnClickListener(new OnClickListener() {
               @Override
               public void onClick(View v) {
                     Intent intent = new Intent(getActivity(), NewActivity.class);
                     getActivity().startActivity(intent);
                     getActivity().overridePendingTransition(
                           R.anim.forward_activity_move_in,
                           R.anim.forward_activity_move_out);
               });

However the new animation does not take effect when moves to the new Activity, so I wonder maybe I do it wrong. I hope someone can help me, thx a lot:)

djj0809
  • 111
  • 1
  • 1
  • 5
  • Thanks, I solved this problem, You can find solutions at [link](http://stackoverflow.com/questions/7759314/change-activity-transition-when-inside-a-tabhost). Well the problem is not the case of Fragment, instead the TabActivity causes the problem. – djj0809 Aug 21 '12 at 05:41

1 Answers1

3

Thanks, I solved this problem, You can find solutions at Change activity transition when inside a TabHost

Well the problem is not the case of Fragment, instead the TabActivity causes the problem.

Community
  • 1
  • 1
djj0809
  • 111
  • 1
  • 1
  • 5