Java – why does overridepending transition not take effect when jumping from fragment to new activity?

The first activity contains a clip with a button inside. When I click this button, I want to jump to a new activity with different animation So I did this in the clip:

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, when moving to a new activity, the new animation will not take effect, so I think maybe I did wrong I hope someone can help me, a lot:)

Solution

Thank you. I have solved this problem. You can find the solution in change activity transition when inside a tabhost

Then the problem is not fragment, but tabacity

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>