我已经拿起了我正在尝试理解并在我的应用程序中工作的这段代码,它应该从父表中删除一行,而子表上的任何行也与之相关while 循环中的一个错误,我理解这个错误,但不完全理解这个人是如何让它工作的
public boolean removeRow(int paramInt, String paramString)
{
int i = 1;
if (paramString.equals("nameTable"))
{
SQLiteDatabase localSQLiteDatabase1 = this.db;
String str1 = "name_ref_ID=" + paramInt;
int j = localSQLiteDatabase1.delete("itemTable", str1, null);
SQLiteDatabase localSQLiteDatabase2 = this.db;
String str2 = "names_id=" + paramInt;
if (localSQLiteDatabase2.delete(paramString, str2, null) <= 0);
}
while (true)
{
return i;// shows errror here as its not returning a bool
i = 0;
continue;
if (paramString.equals("itemTable"))
{
SQLiteDatabase localSQLiteDatabase3 = this.db;
String str3 = "item_id=" + paramInt;
if (localSQLiteDatabase3.delete(paramString, str3, null) > 0)
continue;
i = 0;
continue;
}
i = 0;
}
}
对我来说,返回似乎不合适,并且会阻止执行循环的其余部分。