My method receives a Contentvalues object that is populated with keys and values in another section of my program. Given this Contentvalues object, is it possible to find the type/Class of the inserted value for a given key?
If it helps, I know that the type is restricted one among, Integer, Long, String or a byte[]
Thank you
Not readily. You could call
valueSet(), iterate to find the value, then check the class of the corresponding valueObject. I believe this qualifies as “clunky”. 🙂Unfortunately,
ContentValuesis final, so there’s nothing you can even do by creating your own subclass.