Android animate to singleTask

2019-07-20 04:30发布

I am making an app with multiple tabs (without the tabview). One takes a long time to load so I made a singletask of it. Now it only has to load once what saves a lot of time.

Only in the onCreate I define the transition I want: overridePendingTransition(R.anim.fade_in, R.anim.fade_out);

Only the onCreate is never called again, i tried to put it on top of the onResume and onStart but that didn't helped either.

The problem now is that the animation becomes the default animation which differs a lot on different devices.

Does anyone know a way to change this? I tried calling it after the startActivity method with no succes either.

If anyone has a solution to stop the loadtime then it is also okey. The load time goes to making multiple listview in a swipeview (jason fry). This listview contains around 90 imageviews each, most of them are the same image.

Thanks for any thoughts, ideas or solutions in advance.

2条回答
Emotional °昔
2楼-- · 2019-07-20 04:50

You could try calling that in the onNewIntent() method. That should be called when you try to launch the Activity a second time.

查看更多
劫难
3楼-- · 2019-07-20 04:57

You should override the finish() method of your activity. In the overridden method, after calling super.finish() - call overridePendingTransition() with your favorite transition (if you want no transition - define a transition that does nothing, with duration 0).

查看更多
登录 后发表回答