Commit 23316907 authored by Kristin Muterspaw's avatar Kristin Muterspaw
Browse files

If files already exist in the directory, those are listed to the screen by default.

parent d514a4a1
......@@ -13,6 +13,7 @@ import android.preference.PreferenceManager;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ListView;
......@@ -40,7 +41,7 @@ public class MyDocumentsActivity extends Activity {
private static final String TAG = "MyDocumentsActivity";
public static List<String> downloadList, dirList;
public static ArrayList<File> localDirList;
private Boolean firstPage = true, insideDirectory = false;
private Boolean firstPage = true;
private String baseURL = "", currentPath = "", currentDir = "", initialDir = "";
private ListView filesListView;
private MyDocumentsAdapter myDocumentsAdapter;
......@@ -63,16 +64,28 @@ public class MyDocumentsActivity extends Activity {
}
});
downloadList = new ArrayList<String>();
dirList = new ArrayList<String>();
localDirList = new ArrayList<File>();
firstPage = true;
File rootDir = new File(directory);
for (File f : rootDir.listFiles()){
localDirList.add(f);
}
firstPage = true;
context = this;
filesListView = (ListView) findViewById(R.id.listFileResults);
myDocumentsAdapter = new MyDocumentsAdapter(context, localDirList);
filesListView.setAdapter(myDocumentsAdapter);
filesListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
}
});
settings= PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
editor = settings.edit();
......@@ -127,6 +140,7 @@ public class MyDocumentsActivity extends Activity {
return null;
}
private class GetListOfFiles extends AsyncTask<String, Void, Boolean> {
@Override
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment