So, I have this ActivityGroup in which I show 2 actions. When I switch, I want to have this transition effect, the current view shifts to the left of the screen, and the new view goes to the right. This is my code for switching, assuming the current viewA view:
Intent i = new Intent(this, ViewA.class); viewB = getLocalActivityManager().startActivity("viewb", i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)).getDecorView(); setContentView(viewB);
Now, when I do the following, the viewB background will be displayed, and the contents of the viewB inserted, this is not what I want:
Animation animIn = AnimationUtils.loadAnimation(this, R.anim.righttoleftin); viewB.startAnimation(animIn); Animation animOut = AnimationUtils.loadAnimation(this, R.anim.righttoleftout); viewA.startAnimation(animOut); setContentView(viewB);
How can i achieve this?
Actually, the above works. I had a problem when I thought that viewA is shown until it is.
source share