@Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); switch (requestCode) { case EVIDENCE_CODE: if (resultCode == RESULT_OK) { inspection.evidence = data.getStringExtra("evidance"); // Toast.makeText(getApplicationContext(), evidence, // Toast.LENGTH_LONG).show(); } break; case CAPTURE_REQUEST_ID: if (resultCode == RESULT_OK) { String key = data.getStringExtra("KEY"); @SuppressWarnings("unchecked") ArrayList<InspectionPest> arr = (ArrayList<InspectionPest>) ((FieldworkApplication) getApplication()).getStoredObject(key); ((FieldworkApplication) getApplication()).removeStoredObject(key); m_inspectionPests = arr; } break; case MATERIAL_REQUEST_ID: if (resultCode == RESULT_OK) { m_inspection_material = InspectionMaterial.getAll(); bindMaterial(m_inspection_material); } break; default: break; } }
public void loadMaterial() { if (inspection != null) { if (inspection.Material_ids != null && inspection.Material_ids.length() > 0) { m_inspection_material = new ArrayList<InspectionMaterial>(); String ids[] = inspection.Material_ids.split(","); for (String s : ids) { InspectionMaterial.AddMaterial(Utils.ConvertToInt(s)); } m_inspection_material = InspectionMaterial.getAll(); bindMaterial(m_inspection_material); } } }
@Override protected void onDestroy() { super.onDestroy(); InspectionMaterial.ClearDB(); }