The current flow of my app is Activity A -> Activity B ->Fragment B
I am trying to implement Activity transition animation. I have read many posts on SO mentioning about using overridependingtransition() and I have implemented almost everything mentioned in these posts. Somehow the animation is not working.
I need this to work on Android 2.2 i.e. sdkversion 8
This is the code:
Activity A
oncreate method
Intent detailIntent = new Intent(this, WordDetailActivity.class);
detailIntent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
detailIntent.putExtra(DbAdapter.KEY_ROWID, id);
startActivity(detailIntent);
overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);
@Override
protected void onPause() {
super.onPause();
overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);
}
Activity B
@Override
protected void onPause() {
// TODO Auto-generated method stub
super.onPause();
overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
}
It would be great if someone could also suggest me any alternative way to implement activity transitions upto android 2.2
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…