我知道Cursor有get String, Int等方法,但不是有些东西
mycursor.GetObject(index)
Run Code Online (Sandbox Code Playgroud)
我想创建一个返回一个对象的动态方法,我只抛出它.
或者可以
mycursor.GetString(index)用于任何类型? String,Float,Double,Long,Short, Blob,Int,等等
我可以使用例如a Float或a Int或任何类型并投射它?
例如
(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);
Run Code Online (Sandbox Code Playgroud)
会有用吗?我可以mycursor.GetString()用于任何类型吗?
javadocs表明android.database.Cursor有一个getType(int)方法.但是,当我尝试调用此方法时,Eclipse会给出一个错误,指出不存在任何方法.是什么赋予了?