My question is that: Android SDK has a class was named ContentValues.
That class keeps our values to save them to DB easily.
But it has these methods:
put(String key, Integer value)
put(String key, Float value)
put(String key, Byte value) etc
so this means it can take and keep Integer, Byte, Float, Double…etc.
I wonder how this class can keep all these different-typed variables?
I know how to use it. I wonder how can we write a class like that
Any idea?
You mean how it’s implemented? Or how it’s used? For that, check the NotePad sample app that came with the SDK.