1
我想比較有什麼我迄今所做的SQLite表和web服務的ID值SQLite和JSON數組不等於就是值在Android的
if(data_exist!=bookProduct.length()){
Log.i("in update","m here");
Cursor cursors = getRawEvents("select id from bcuk_book");
try{
for (int i = 0; i < bookProduct.length(); i++)
{
JSONObject c = bookProduct.getJSONObject(i);
String Bid = c.getString(TAG_ID);
ArrayList<String> mapId = new ArrayList<String>();
while(cursors.moveToNext())
{
Log.e("cursors",cursors.getString(0));
Log.i(Bid,Bid);
if(cursors.getString(0)!=c.getString(TAG_ID)){
Log.e("fas",Bid);
}
}
mapId.add(TAG_ID);
Log.e(Bid,Bid);
}
}
我的問題是我得到相同的值在日誌..
if(cursors.getString(0)!=c.getString(TAG_ID)){
這種情況下說,如果他們不相等,然後打印log..But的問題就是我進入該塊甚至我收到來自SQLite和TAG_ID即相同的值從JSON Web服務。如何解決這個問題。我做錯了什麼?