且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

不在模拟器上的Android设备上的IndexOutOfBoundsException错误

更新时间:2023-01-05 09:12:12

您的游标/数据库可能为空-没有行.试试:

Your cursor/database is probably empty - no rows. Try:

if (cur.moveToFirst()) { // returns false if cursor is empty
    widget_enabled = cur.getInt(0);
} else {
    widget_enabled = 0;
}