以下语句cursor.moveToNext()始终为false.我希望循环执行一次.我已经测试过查询实际返回的数据.
有谁知道是什么事吗?
String query ="SELECT(SELECT COUNT(*) FROM Table1) as count1, (SELECT COUNT(*) FROM Table2) as count2;";
Cursor mCursor = mDb.rawQuery(query, null);
if (mCursor != null) {
mCursor.moveToFirst();
}
while (cursor.moveToNext()) { //<---------------return false here???
String result_0=cursor.getString(0);
}
Run Code Online (Sandbox Code Playgroud) 我想开发一款Android应用.我想从用户那里获得输入并将其存储在手机的数据库中.
即使手机关机,我的数据也应保留在手机中.这可能使用SQLite数据库吗?
我正在使用MVC Extjs,我希望在按钮的click事件上运行两个不同的函数.到目前为止这是我的控制器代码:
Ext.define('MyApp.controller.myController', {
extend: 'Ext.app.Controller',
runFirst: function(button, e, options) {
console.log('first function is running');
},
runSecond: function(button, e, options) {
console.log('second function is running');
},
init: function(application) {
this.control({
"#myButton": {
click: this.runFirst, runSecond //THIS PART DOESN'T WORK :(
}
});
}
});
Run Code Online (Sandbox Code Playgroud)
当我点击myButton时,我无法同时运行runFirst并runSecond运行.
您可以在此处下载所有代码:https://github.com/nitzaalfinas/Extjs-run-2-function-with-one-click/tree/one
你能告诉我如何在单击按钮上运行两个功能吗?