If I start a new project in Android Studio v2.1.2 and add a second activity so I have two, when I switch activities there is no slide animation. When I try to search for answers, it looks like the slide animation is the default, so I don't understand why it's not sliding. Instead, the second activity is instantly displayed with no animation. I'm switching activities like this:
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle item selection
switch (item.getItemId()) {
case R.id.goToMain:
return true;
case R.id.goToSecond:
goToSecond();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
public void goToSecond(){
Intent intent = new Intent(this, SecondActivity.class);
startActivity(intent);
}
I know it's not critical, but it might add some flare. I have tried a lot of things and cannot find a way to make this work. For instance, everything I could find in the android developer training is for a higher API level. I'm using a min API level of 15, because that matches the level on my phone.
It looks like what I'm looking for might also be called a transition, but whatever it's called I'd just like to know why the slide animation is not happening. How can I add it?