Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get the imagelevel of an ImageView?

In my app I'm using a few Imageviews with LevelListDrawables to be able to change then dynamically.

But now I want to know if I can read in which level the ImageView is stated, I set the level with setImageLevel() but there is no against hanging method to get the imagelevel.

So my question is: Is there a way to get the current imagelevel of an imageview?

like image 314
Ion Aalbers Avatar asked Oct 27 '25 21:10

Ion Aalbers


1 Answers

You can't do it directly to the ImageView, but you can do this

imageView.getDrawable().getLevel()

That will do the trick, for further information the offical documentation for Drawable#getLevel()

like image 95
Necronet Avatar answered Oct 30 '25 12:10

Necronet