开发者

Error in execSQL in running app on phone

开发者 https://www.devze.com 2023-04-10 15:15 出处:网络
I\'ve created an app that will set an alarm for a specified date and store some data for this alarm in开发者_如何学Python a database. The app works fine in my emulator but when I try to run it on my p

I've created an app that will set an alarm for a specified date and store some data for this alarm in开发者_如何学Python a database. The app works fine in my emulator but when I try to run it on my phone it crashes. I managed to trace the source of the crash to this line of code:

String newTableQueryString = "create table" + TABLE_NAME + " (" + TABLE_ROW_ID + 
"integer primary key autoincrement not null," + TABLE_ROW_ONE + " text" +");";
// execute the query string to the database. This is what's causing the crash
db.execSQL(newTableQueryString);

Can someone help me with this problem?

Thanks,


Looks like you're lacking spaces in some places, so final SQL string migth be incorrect. For instance add space after create table string, like here

String newTableQueryString = "create table " + TABLE_NAME + ...
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号