I am trying to traverse all the folders in the file system. and I want to index all the traversed files. When I am trying to do the indexing with SQLite db, the app doesn't respond. What is the way to get it working?
private class StartIndexing extends AsyncTask<File, String, String>{
@Override
protected String doInBackground(File... params) {
String indexDone="0";
File file=params[0];
indexIn(file);
indexDone="Async Done";
return indexDone;
}
protected void indexIn(File folder){
File[] dirs=folder.listFiles();
for(File val:dirs){
if(val.isDirectory()){
new StartIndexing().executeOnExecutor(THREAD_POOL_EXECUTOR,val);
count++;
}
else{
DBoperation(val);
filecount++;
}
}
}