我有一个数据库,我打开它并使用游标提取我需要的查询。如何检查我提取的变量是 int 还是 string?因为我不知道我在打开哪张 table ,所以一切都是动态的。所以我不能使用 cursor.getString()
或 cursor.getInt()
编辑
抱歉我的英语不好,我是意大利人
最佳答案
找到了。此方法有效:
public boolean isInt(String s){
boolean result=false;
try{
Integer.parseInt(s);
result=true;
}catch(Exception e){
}
return result;
}
关于android - 动态检查类型的变量android,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12373039/