Home Ask Login Register

Developers Planet

Your answer is one click away!

Nikz11 February 2016

Android Object Animator throwing cannot resolve type

I'm trying to create an Object Animator in Android using the following code:

ObjectAnimator animation = new ObjectAnimator.ofInt(...);

although the compiler keeps throwing an error under "ofInt" saying:

Cannot resolve Symbol 'ofInt'

What am I doing wrong it's driving me crazy.

Answers


yUdoDis February 2016

new ObjectAnimator().ofInt(..)

i think youre forgetting () *constructor/method call


Xoce 웃 Пepeúpa February 2016

The call ObjectAnimator animation = new ObjectAnimator.ofInt(...); is wrong, you need to call the constructor properly and then call the methods you need...

ObjectAnimator animation = new ObjectAnimator();
animation.ofInt(...);

Post Status

Asked in February 2016
Viewed 3,250 times
Voted 7
Answered 2 times

Search




Leave an answer


Quote of the day: live life