I m working on a Android Java Plugin for Unity3D.
I my Android Project, I have a class which is not extending Activity, but i m calling a function from unity & sending current activity in it.
public class abc{
void init(final Activity currActivity, .. and some other params)
{
.....
my code here.//
.... .
}
}
I was using
currAnimation_StartAd = AnimationUtils.loadAnimation(currActivity, R.anim.slide_in_right);
to load my animation from res folder when i was extending Activity.
Now my Problem is, i can’t access res folder bcoz i m no more extending Activity.
Actually even i m not getting any compile time error on R.anim.slide_in_right.
But in runtime, Resource R.anim.slide_in_right: 0x7f040001 not found..
Is there any way to load my animations from assets folder.?
Thankx.
You can use getApplicationContext() in that case.. change your like code to
and this should work.
or better explained by gautam with currAnimation_StartAd = AnimationUtils.loadAnimation(currActivity.getApplicationContext, R.anim.slide_in_right);