Blue Fishy Blue Fishy - 5 months ago 35
Android Question

Android R.anim.files cannot be found

I am not sure if it is only me but strangely, I cannot access slide_in_right.xml and slide_out_left.xml inside res/anim that I created


I am using this line of code to access the animation

UserProfile.this.overridePendingTransition(android.R.anim.slide_in_right, android.R.anim.slide_out_left);


However, it underlines the slide_in_right and slide_out_left saying that it cannot Resolve symbol.

Methods tried:

1. Clean the project

    Still cannot Resolve symbol for both android.R.anim.slide_in_right and
    android.R.anim.slide_out_left


2. Rebuild project

    Gives me an error saying error: cannot find symbol variable slide_in_right


3. Double checked if i spelled the anim uncorrectly but it seem to be correct




Some information:

------------------

Android Studio 1.5.1

Build #Al-141.2456560, built on December 1, 2015

JRE: 1.7.0_79-b15 x86_64




Did anyone came across this problem before?

Answer

As you have created the animation files inside your project, this should use your project R reference instead of android.R. Try to use like this.

UserProfile.this.overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
Comments