且构网

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

如何从列表视图,并从数据库中删除项目?

更新时间:2022-04-18 22:07:06

在Java中的字符串由完成.equals()的比较 equalsIgnoreCase ()方法,而不是与 ==
这可能是不是你的到达声明的原因。如果你这样做这个==是意味着你检查,如果两者是相同的参考。 (是它的到达,因为他们两个都是字符串:P)

Comparing of strings in Java is done by .equals() or equalsIgnoreCase() methods, not with == Which might be the cause your statement not being reachable. If you do "this"=="that" means you are checking if both of them are of same reference. (yes its reachable, since both of them are strings :P )

请确保您的数据库对象不为空,也检查是否有任何异常被捕获。加:尝试从光标还删除的数据。

Make sure your database object is not null and also check if any exception is caught. Plus: Try removing the data also from the cursor.