Thursday, 8 August 2013

Android Cursor? how to read object data?

Android Cursor? how to read object data?

i know a Cursor has method for get String, Int, etc but isn't there
somethings as
mycursor.GetObject(index)
I want to create a dinamic method which return a object and I only cast it.
or is it posible use mycursor.GetString(index) for any type?
String,Float,Double,Long,Short, Blob,Int,etc
and I can use for example for a Flot or a Int or any type and cast it?
for example
(Blob) newblob=mycursor.GetString(i_return_BloB);
(Int) newint=mycursor.GetString(i_return_Int);
(Float) newfloat=mycursor.GetString(i_return_Float);
(Double) newdouble=mycursor.GetString(i_return_Double);
(Long) newlong=mycursor.GetString(i_return_long);
(Short) newshort=mycursor.GetString(i_return_short);
would it work? could i use mycursor.GetString for any type?

No comments:

Post a Comment