Android Sqlite selection args[] with int values

后端 未结 3 1382
执念已碎
执念已碎 2020-11-29 11:02

Have this line of code in the getEvents method of my DBHelper.

    int year, month, day;
    String[] columns = new String[] { KEY_EVENTNAME, KEY_DESCRIPTION         


        
3条回答
  •  旧巷少年郎
    2020-11-29 11:24

    Thank you for all your help. After considering everything you suggested, I have finally found out the cause why it always returns nothing. The month value that I passed to this method was incorrect. It was a month ahead that's why it returns 0 for the current month. I'm sorry for the trouble. But all your answers are correct. It was a fault that I believe most or some have experienced. As a learning, I'd give extra care in looking into the values that I pass. Carefully looking into the flow of the values that are passed between methods saves time. I spent the whole night looking for the problem and just this morning after waking up I remembered the value that was passed into the method. Thanks again to everyone who gave the answers.

提交回复
热议问题