@Override public boolean onChildClick( ExpandableListView parent, View v, int groupPosition, int childPosition, long id) { String val = m_vFiles.getChildPath(groupPosition, childPosition); if (val != null) { if (m_doc != null) { m_vPDF.Close(); m_doc.Close(); m_doc = null; } m_doc = new Document(); int ret = m_doc.Open(val, null); switch (ret) { case -1: // need input password finish(); break; case -2: // unknown encryption finish(); break; case -3: // damaged or invalid format finish(); break; case -10: // access denied or invalid file path finish(); break; case 0: // succeeded, and continue break; default: // unknown error finish(); break; } m_vPDF.Open(0, m_doc); setContentView(m_vPDF); } return false; }
@Override protected void onDestroy() { if (m_vPDF != null) m_vPDF.Close(); Global.RemoveTmp(); super.onDestroy(); }