如果我收到以“完成”开头的短信,我想从数据库和列表中删除案例。
这是我的代码;你能告诉我我错过了什么吗?
另外,我应该从DataBase和List中删除它吗?
还是什么?
if (SMSReceived.startsWith("Done")) {
Toast.makeText(context, "Iam in tm", Toast.LENGTH_LONG).show();
int indx = SMSReceived.indexOf(":");
String caseId = SMSReceived.substring(indx+1); dbAdapter.delete(caseId);
// =====================Step 1=====================
// For Taking Case ID
String mCancelMsg = SMSReceived;
String mRecentCaseID= mCancelMsg.substring(21,25);
String icase = Integer.toString(recent1.getID());
// For searching Recent Case ID
for (RecentCaseClass recent1 : All_Static.getRecentCaseList())
{
if (mRecentCaseID == icase)
{
RecentCaseListAdapter.listOfCases.remove(recent1);
//dbAdapter.delete(entry.getName());
adapter.notifyDataSetChanged();
All_Static.RecentCaseList.remove(recent1);
}
}
}