mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-09 07:16:04 -04:00
+ fix strange crashs with "open file"
This commit is contained in:
parent
921e23dcd5
commit
0a985f534a
@ -27,6 +27,7 @@ LoaderManager.LoaderCallbacks<Cursor> {
|
|||||||
private static final int LOADER_ID = 0x02;
|
private static final int LOADER_ID = 0x02;
|
||||||
private SimpleCursorAdapter mCursorAdapter;
|
private SimpleCursorAdapter mCursorAdapter;
|
||||||
private ListView zimFileList;
|
private ListView zimFileList;
|
||||||
|
private View tmpZimFileList;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
@ -72,16 +73,21 @@ LoaderManager.LoaderCallbacks<Cursor> {
|
|||||||
// Sets the adapter for the ListView
|
// Sets the adapter for the ListView
|
||||||
setContentView(R.layout.zimfilelist);
|
setContentView(R.layout.zimfilelist);
|
||||||
|
|
||||||
|
// For a reason I ingore, it seems that time to time
|
||||||
zimFileList = (ListView) findViewById(R.id.zimfilelist);
|
// tmpZimFileList is not castable in ListView. Kelson
|
||||||
getLoaderManager().initLoader(LOADER_ID, null, this);
|
tmpZimFileList = findViewById(R.id.zimfilelist);
|
||||||
zimFileList.setAdapter(mCursorAdapter);
|
if (tmpZimFileList instanceof ListView) {
|
||||||
zimFileList.setOnItemClickListener(new OnItemClickListener() {
|
zimFileList = (ListView) tmpZimFileList;
|
||||||
|
getLoaderManager().initLoader(LOADER_ID, null, this);
|
||||||
|
zimFileList.setAdapter(mCursorAdapter);
|
||||||
|
zimFileList.setOnItemClickListener(new OnItemClickListener() {
|
||||||
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
|
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
onListItemClick((ListView) arg0, arg0, arg2, arg3);
|
onListItemClick((ListView) arg0, arg0, arg2, arg3);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
//TODO close cursor when done
|
//TODO close cursor when done
|
||||||
//allNonMediaFiles.close();
|
//allNonMediaFiles.close();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user