Was trying to implement the snippet below. [from developer documentation here]:
View myView = findViewById(R.id.my_view);
// get the center for the clipping circle
int cx = (myView.getLeft() + myView.getRight()) / 2;
int cy = (myView.getTop() + myView.getBottom()) / 2;
// get the final radius for the clipping circle
int finalRadius = Math.max(myView.getWidth(), myView.getHeight());
// create the animator for this view (the start radius is zero)
Animator anim =
ViewAnimationUtils.createCircularReveal(myView, cx, cy, 0, finalRadius);
// make the view visible and start the animation
myView.setVisibility(View.VISIBLE);
anim.start();
Gettting the error below. Why is it so and how can i fix this.
java.lang.NoClassDefFoundError: android.view.ViewAnimationUtils
at dejavu.appzonegroup.com.dejavuandroid.Fragment.PeopleTabFragment$1.onItemClick(PeopleTabFragment.java:59)
at android.widget.AdapterView.performItemClick(AdapterView.java:299)
at android.widget.AbsListView.performItemClick(AbsListView.java:1152)
ViewAnimationUtils was added in API level 21 (Lollipop 5.0). Are you testing your app on Lollipop? It will not work on older API levels. To use it you need to set min SDK to 21.
One google search brought me this, it gives you 3 ways to solve your problem. I'll quote a few wich I think that might resolve your problem:
1) Class is not available in Java Classpath.
2) You might be running your program using jar command and class was not defined in manifest file's ClassPath attribute.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With